无法创建文件Heroku Cedar-14 [英] Can't create files Heroku Cedar-14

查看:114
本文介绍了无法创建文件Heroku Cedar-14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个应用程序

pre code应用程序文件夹
|
--- index.php
---文件夹1
---文件夹2

我想在'Application文件夹'外创建一个数据文件夹。



问题:如果我在树中进入1并尝试执行git push,heroku不会让我

  + 1应用程序文件夹
|
+ ---应用程序文件夹
+ ---数据文件夹

我不能ssh到框中,并创建一个文件夹,因为它告诉我这是一个只读文件系统。



供参考:仪表板应用程序设置表示它在雪松14上。而且我正在运行一个免费帐户。

解决方案

即使您在某处使用SSH,也会是一个孤立的实例。想象一下从1到100 dynos的缩放,然后在其中一个文件系统上进行修改,应该如何在同步等方面进行工作?我假设你想添加文件在 index.php 之外的地方,所以你基本上想要将项目的文档根目录更改为子目录。



您的从应用程序文件夹+1是Git项目的根目录,而您的应用程序文件夹是文档根目录。按照此处的说明创建 Procfile ,将文档根设置为您的应用程序文件夹: https://devcenter.heroku.com/articles/custom-php-settings#setting-the-document-root



然而,您会意识到,您在本地计算机上无法读取您在dyno上写入数据文件夹的任何内容,对吧?你不能下载它,它是一个Git回购。您在一个测功机上编写的数据也不会在其他测功机上使用(例如,当您< heroku ps:scale web = 10 有十个dynos时),并且每次或者在$ 24小时之后(当dynos自动重新启动时),对本地文件系统的任何更改都将消失。

$ b $ git push b

So I have an application

  + Application Folder
  |
   --- index.php
   --- folder 1
   --- folder 2

I want to create a data folder outside this 'Application folder'.

Problem: If I go 1 up in the tree and try to do a git push, heroku doesn't let me

+ 1 up from application folder
  |
  + --- Application Folder
  + --- Data folder

And I can't ssh into the box and create a folder because it tells me it's a read only file system.

FYI: The dashboard app settings say it's on cedar 14. And I'm running on a free account.

解决方案

Even if you SSH in somewhere, that would be an isolated instance. Imagine scaling from 1 to 100 dynos and then making a filesystem modification on one of them, how should that work in terms of syncing etc?

I assume you want to add files outside of where index.php lives, so you basically want to change the document root for the project to a subdirectory.

Your "+1 up from application folder" is then the Git project root, and your application folder is the document root. Create a Procfile as instructed here to set the document root to your application folder: https://devcenter.heroku.com/articles/custom-php-settings#setting-the-document-root

You do realize however that anything you write into the data folder on a dyno will not be available on your local computer, right? You can't "download" it, it's a Git repo. The data you write on one dyno also will not be available on other dynos (e.g. when you heroku ps:scale web=10 to have ten dynos), and every time you scale up or down, git push, or just after around 24 hours (when dynos auto restart), any changes to the local filesystem will be gone.

这篇关于无法创建文件Heroku Cedar-14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆