Heroku php app crash bash: vendor / bin / heroku-php-apache2: No such file or directory

I'm not very good at configuring Heroku

I am trying to install an online application in PHP (using Code Igniter), but it does not work. Here is the error:

Heroku PHP app crash bash: vendor/bin/heroku-php-apache2: No such file or directory 

index.php is located in the root folder. The suppliers directory is also located in the root folder. The composer did his work. 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 path, so I don't like the new way. I followed this guide https://devcenter.heroku.com/articles/getting-started-with-php#introduction

I think I missed something obvious. But I do not know what. Thanks you

+7
php codeigniter-2 heroku
source share
5 answers

Your composer.json will most likely override the bin-dir parameter to something other than vendor/bin . Run composer config bin-dir to find out what it is (or look in the composer.json config section and configure the path to heroku-php-apache2 in Procfile .

You can also simply modify the Procfile to automatically read the correct value:

 web: $(composer config bin-dir)/heroku-php-apache2 

Notes at https://devcenter.heroku.com/articles/php-support#web-servers also mention this bin-dir warning.

+12
source share

My solution was to add the code below composer.json .

 "require-dev": { "heroku/heroku-buildpack-php" : "dev-master" } 

Then run composer update .

+1
source share

You tried to remove your procfile and add the base composer .json

0
source share

Thanks to David, here is the answer:

You are using an outdated version of buildpack - your application has BUILDPACK_URL installed at https://github.com/heroku/heroku-buildpack-php.git#legacy . Run the heroku configuration: undo BUILDPACK_URL and push the empty change (git commit -m "new buildpack" --allow-empty will do).

Because I copy / paste the old vars from the old project (> 1 year) using boot.sh

There was a BUILDPACK_URL which was a bad url. No need to put it now.

Thanks dzuelke!

0
source share

In addition to the following steps, as described here:

https://devcenter.heroku.com/articles/getting-started-with-laravel

I had to remove .env from gitignore as well as install

APP_KEY generated using

php artisan key: generate --show

to.env

to make it work.

0
source share

All Articles