0

Trying to push my PHP code to Heroku always results in the following:

remote: ! ERROR: Application not supported by this buildpack!

remote: !

remote: ! The 'heroku/php' buildpack is set on this application, but was

remote: ! unable to detect a PHP codebase.

I am aware that I must have an index.php file and a composer.json file in the root directory of my repository. All threads online of deployment not working is always one of these stupid mistakes. Since Heroku was not able to detect that it should use a PHP buildpack, I manually selected it, leading to the error above.

I could really use some help - I have no idea what is wrong.

Here's a screenshot of the root directory of my repository:

And here's a screenshot of the full failed buildlog on Heroku:

  • kinda hard to tell without knowing how your app is setup, i would refer to the php-getting-srtarted repository. – glls Jun 9 '19 at 19:00
  • @glls There is literally no setup. What you see is what's there. Index.php contains some dummy code and composer.json contains { }. Docs contains unrelated documentation. The first two things mentioned are what's necessary for heroku to identify a PHP deployment no? – Noah C. Jun 10 '19 at 10:43
0

Finally found the solution...

Heroku wasn't detecting any PHP... because there was no PHP!

Heroku by default only pushes code from the master branch of your repository to the master branch of their own repository. This means that any code in any branch of your repository other than master, well, is useless.

Since when I was cloning my repo I was using a testing branch, the php file I added was useless.

To push to heroku from a branch other than master, use the following command:

git push heroku branch-name:master

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.