I'm not very good with Heroku setup
I'm trying to put online an app in PHP (with Code Igniter) but it doesn't work well. Here is the error :
Heroku PHP app crash bash: vendor/bin/heroku-php-apache2: No such file or directory
index.php is in root folder. Vendor directory also in root folder composer made his job In procfile :
web: vendor/bin/heroku-php-apache2
And in my index.php:
require('vendor/autoload.php');
In the past I used the boot.sh way, so I'm not comfortable with the new way. I followed this tutorial https://devcenter.heroku.com/articles/getting-started-with-php#introduction
I think I missed something obvious. But I don't know what. Thank you
Did you try to remove your procfile and add the base composer.json
My solution was to add the code below to
composer.json
.Then run
composer update
.Your
composer.json
likely re-defines thebin-dir
setting to something other thanvendor/bin
. Runcomposer config bin-dir
to see what it is (or look at yourcomposer.json
'sconfig
section, and adjust the path toheroku-php-apache2
in yourProcfile
accordingly.You can also just change the
Procfile
to automatically read the right value:The notes at https://devcenter.heroku.com/articles/php-support#web-servers also mention this
bin-dir
caveat.Thanks To David, here is the answer :
You're using the legacy version of the buildpack - your app has BUILDPACK_URL set to https://github.com/heroku/heroku-buildpack-php.git#legacy. Run heroku config:unset BUILDPACK_URL and push an empty change (git commit -m "new buildpack" --allow-empty will do).
Because I Copy/pasted old vars from an old project (> 1 year) using boot.sh
There was BUILDPACK_URL which was the bad URL. No need to put it now.
Thanks dzuelke !
In addition to following the steps exactly as described here :
https://devcenter.heroku.com/articles/getting-started-with-laravel
I had to remove .env from gitignore and also set
APP_KEY generated using
php artisan key:generate --show
to .env
in order for this to work.