Push rejected, failed to detect set buildpack heroku/php

可紊 提交于 2019-12-05 03:55:50

In my case, I needed to have a composer.json file in the same directory where my git folder is. Also make sure you included the json file in your commit before trying to do git push heroku master.

My composer.json file contains only this so it's a valid json.

{ }

I found out what was wrong. In my git repo, I had a separate folder that had all the html and php files that would display the website. Once I moved them out to the main directory, heroku was able to detect that it's a php app.

Please make sure you do the following things.

  • Create a index.html with some test data.
  • Create composer.json that has only {} in the file
  • Create index.php that has <?php include_once("index.html"); ?>
  • Now commit these and push using this command git push heroku master

all the files should be in same directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!