Max*_*Max 8 php heroku codeigniter-2
Heroku设置我不是很好
我正在尝试将应用程序放在PHP中(使用Code Igniter),但它不能正常工作.这是错误:
Heroku PHP app crash bash: vendor/bin/heroku-php-apache2: No such file or directory
Run Code Online (Sandbox Code Playgroud)
index.php在根文件夹中.供应商目录也在根文件夹编写器中完成了他的工作在procfile中:
web: vendor/bin/heroku-php-apache2
Run Code Online (Sandbox Code Playgroud)
在我的index.php中:
require('vendor/autoload.php');
Run Code Online (Sandbox Code Playgroud)
在过去我使用boot.sh方式,所以我对新方式感到不舒服.我按照本教程 https://devcenter.heroku.com/articles/getting-started-with-php#introduction
我想我错过了一些明显的东西.但我不知道是什么.谢谢
dzu*_*lke 17
您composer.json可能会将bin-dir设置重新定义为其他内容vendor/bin.运行composer config bin-dir,看看它是什么(或者看看你composer.json的config部分,调整路径,heroku-php-apache2在Procfile相应.
您也可以更改Procfile为自动读取正确的值:
web: $(composer config bin-dir)/heroku-php-apache2
Run Code Online (Sandbox Code Playgroud)
https://devcenter.heroku.com/articles/php-support#web-servers上的说明也提到了这bin-dir一点.
我的解决方案是将下面的代码添加到composer.json.
"require-dev": {
"heroku/heroku-buildpack-php" : "dev-master"
}
Run Code Online (Sandbox Code Playgroud)
然后跑composer update。