Heroku does not recognize my Laravel application as a PHP application and does not install the composer

I am trying to publish a Laravel app on Heroku. I excluded the composer.lock file from .gitignore and created a Procfile file containing

web: vendor/bin/heroku-php-apache2 public 

I created my application using

 heroku create myapp; git push heroku master; 

Then I get the following output:

 git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags heroku master:master Pushing to https://git.heroku.com/myapp.git POST git-receive-pack (1914 bytes) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: -----> Resetting git environment remote: remote: PRO TIP: Specify a node version in package.json remote: See https://devcenter.heroku.com/articles/nodejs-support remote: remote: -----> Defaulting to latest stable node: 0.10.35 remote: -----> Downloading and installing node remote: -----> Exporting config vars to environment remote: -----> Installing dependencies remote: npm WARN package.json myapp@0.0.0 No repository field. remote: -----> Cleaning up node-gyp and npm artifacts remote: -----> Building runtime environment remote: -----> Discovering process types remote: Procfile declares types -> web remote: remote: -----> Compressing... done, 9.6MB remote: -----> Launching... done, v5 remote: https://myapp.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/myapp.git 5b1c663..0dff021 master -> master updating local tracking ref 'refs/remotes/heroku/master' Completed successfully 

If I go to my application, I get an application error message. When I look at my magazines, he says

 app[web.1]: bash: vendor/bin/heroku-php-apache2: No such file or directory 

I suspect somehow, Heroku did not create the linker , since it was not in my git output, and perhaps he did not even recognize that my application is a PHP application? Of course, I also included the empty index.php file in my root. Did not help.

What am I missing here?

+6
source share
3 answers

I believe that I have found. It is better to read the lines ("Node.js application detected"). Solved by running this command:

 heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php 

and clicking again

+11
source

Haha, just drop package.json into your laravel project. And then Heroku will detect your application as a php project.

+1
source

Be sure to specify the trailing slash public : public/ . That was my problem - I use Laravel and got Image source not readable and NotReadableException in AbstractDecoder.php line 302: because I thought that at AbstractDecoder->init('/app/public') in AbstractDriver.php line 64 is file, not a folder.

0
source

Source: https://habr.com/ru/post/980428/


All Articles