Push rejected, could not detect set buildpack heroku / php

I am trying to deploy my php application from github to heroku, but it does not work. I had experience deploying php applications for a hero, but for some reason this time I have problems.

This is what I did.

  • Created an application in heroku
  • Associated my github with my heroku app
  • Added remote heroku application from my local directory
  • Install buildpack in php
  • Run git push heroku master

The following files are in my directory:

 home.html index.php index.css 

Here is my index.php : Push rejected, failed to detect set buildpack heroku/php

This is what I got after step 5:

 Counting objects: 52, done. Delta compression using up to 4 threads. Compressing objects: 100% (48/48), done. Writing objects: 100% (52/52), 1.12 MiB | 1.23 MiB/s, done. Total 52 (delta 20), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Using set buildpack heroku/php remote: remote: ! Push rejected, failed to detect set buildpack heroku/php remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: Verifying deploy.... remote: remote: ! Push rejected to appp. remote: To https://git.heroku.com/appp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/appp.git' 

Here is my heroku logs :

 2015-11-19T00:22:31.307947+00:00 heroku[api]: Set BUILDPACK_URL config vars by email@gmail.com 2015-11-19T00:22:31.307947+00:00 heroku[api]: Release v3 created by email@gmail.com 2015-11-19T00:22:43.284779+00:00 heroku[slug-compiler]: Slug compilation started 2015-11-19T00:22:43.284789+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php 2015-11-19T00:22:43.284790+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure 2015-11-19T00:27:00.648462+00:00 heroku[api]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile` by email@gmail.com 2015-11-19T00:27:01.379352+00:00 heroku[run.2268]: Awaiting client 2015-11-19T00:27:01.441226+00:00 heroku[run.2268]: Starting process with command `false && AUTOMATED DIAGNOSIS BEING RUN BY HEROKU SUPPORT; cat Procfile` 2015-11-19T00:27:01.858759+00:00 heroku[run.2268]: State changed from starting to up 2015-11-19T00:27:03.971434+00:00 heroku[run.2268]: Process exited with status 1 2015-11-19T00:27:03.989162+00:00 heroku[run.2268]: State changed from up to complete 2015-11-19T00:30:14.310979+00:00 heroku[slug-compiler]: Slug compilation started 2015-11-19T00:30:14.310987+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php 2015-11-19T00:30:14.310988+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure 2015-11-19T00:31:54.735764+00:00 heroku[slug-compiler]: Slug compilation started 2015-11-19T00:31:54.735775+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php 2015-11-19T00:31:54.735776+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure 2015-11-19T00:34:31.326372+00:00 heroku[slug-compiler]: Slug compilation started 2015-11-19T00:34:31.326383+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php 2015-11-19T00:34:31.326385+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure 2015-11-19T00:34:37.003934+00:00 heroku[slug-compiler]: Slug compilation started 2015-11-19T00:34:37.003944+00:00 heroku[slug-compiler]: Slug compilation failed: failed to detect set buildpack heroku/php 2015-11-19T00:34:37.003946+00:00 heroku[slug-compiler]: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure 
+8
git php heroku web-deployment
source share
3 answers

I found out what happened. In my git registry, I had a separate folder with html and php files that would display on the site. As soon as I moved them to the main directory, the hero managed to discover that this is a php application.

0
source share

In my case, I need the composer.json file in the same directory where my git folder is located. Also make sure you include the json file in your message before trying to execute git push heroku master.

My composer.json file contains only this so that it is valid json.

{}

+13
source share

Please make sure that you do the following things.

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

all files must be in the same directory.

0
source share

All Articles