无法创建文件Heroku Cedar-14 [英] Can't create files 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回购。您在一个测功机上编写的数据也不会在其他测功机上使用(例如,当您<
git push
bSo 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屋!