为什么 Heroku 看不到我在部署后创建的文件?
Why doesn't Heroku see a file I create after I deploy?
我想像 Rails 一样在 Yii 中设置资产编译和缩小。
http://www.yiiframework.com/doc-2.0/guide-structure-assets.html
我正在考虑使用 PHP 缩小器。我宁愿不必手动编译资产并将其签入 Git。但是,即使有效,Heroku 似乎也不会为不在 Git 中的新文件提供服务器。为什么?
>heroku run bash
Running `bash` attached to terminal... up, run.6857
~ $ cd web
cd web
~/web $ ls
ls
MySample.php css images index.php robots.txt
assets favicon.ico index-test.php js
~/web $ echo hello > hello.txt
echo hello > hello.txt
~/web $ cat hello.txt
cat hello.txt
hello
~/web $ exit
exit
exit
$ curl -I http://xxxxxx.herokuapp.com/hello.txt
HTTP/1.1 404 Not Found
未找到 hello.txt 的原因是您的 curl -I 请求将由您的应用程序的新实例处理。为了演示,我可以在 bash 中删除我的 index.php,但是当我使用 curl -I 检索它时,我得到 200 OK.
$ heroku run bash
Running `bash` attached to terminal... up, run.3070
~ $ cd web
~/web $ ls
index.php
~/web $ rm index.php
~/web $ ls
~/web $ curl -I http://xxxxx.herokuapp.com/index.php
HTTP/1.1 200 OK
显示它的另一种方法是打开两个不同的 bash 连接,然后 运行 heroku ps
$ heroku ps
=== run: one-off processes
run.3070 (1X): up 2015/04/01 19:30:07 (~ 37m ago): `bash`
run.7783 (1X): up 2015/04/01 19:59:48 (~ 8m ago): `bash`
这两个进程不会共享临时内存。
我想像 Rails 一样在 Yii 中设置资产编译和缩小。 http://www.yiiframework.com/doc-2.0/guide-structure-assets.html
我正在考虑使用 PHP 缩小器。我宁愿不必手动编译资产并将其签入 Git。但是,即使有效,Heroku 似乎也不会为不在 Git 中的新文件提供服务器。为什么?
>heroku run bash
Running `bash` attached to terminal... up, run.6857
~ $ cd web
cd web
~/web $ ls
ls
MySample.php css images index.php robots.txt
assets favicon.ico index-test.php js
~/web $ echo hello > hello.txt
echo hello > hello.txt
~/web $ cat hello.txt
cat hello.txt
hello
~/web $ exit
exit
exit
$ curl -I http://xxxxxx.herokuapp.com/hello.txt
HTTP/1.1 404 Not Found
未找到 hello.txt 的原因是您的 curl -I 请求将由您的应用程序的新实例处理。为了演示,我可以在 bash 中删除我的 index.php,但是当我使用 curl -I 检索它时,我得到 200 OK.
$ heroku run bash
Running `bash` attached to terminal... up, run.3070
~ $ cd web
~/web $ ls
index.php
~/web $ rm index.php
~/web $ ls
~/web $ curl -I http://xxxxx.herokuapp.com/index.php
HTTP/1.1 200 OK
显示它的另一种方法是打开两个不同的 bash 连接,然后 运行 heroku ps
$ heroku ps
=== run: one-off processes
run.3070 (1X): up 2015/04/01 19:30:07 (~ 37m ago): `bash`
run.7783 (1X): up 2015/04/01 19:59:48 (~ 8m ago): `bash`
这两个进程不会共享临时内存。