Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku push rejected no cedar-supported app detected php - index.php present

Tags:

php

heroku

I am trying to push my php app to Heroku and get the below error.

Heroku receiving push ! Heroku push rejected, no Cedar-supported app detected.

I have read through all the previous posts which said that the PHP app should have a index.php in the root folder...which i do. When i do a "git ls-files" i get the index.php listed (with the name in lowercase).

steps i have performed so far are. 1. i have an application created on Heroku - stack:Cedar 2. git add the relevant files 3. git commit with a comment 4. git push heroku master -- this guy gives me the error.

git ls-files lists a file "index.php".

What am i missing this time?

like image 951
Pallavi Singh Avatar asked Sep 04 '13 09:09

Pallavi Singh


2 Answers

I'm just starting out with Heroku and was encountering the same problem. Below is a description of what I did wrong.

Procfile

Make sure that the following statement is included in your Procfile:

web: vendor/bin/heroku-php-apache2 path/to/web/

Where path/to/web/ is the relative path to the directory that you want to publicly expose on the web. Make sure that the public directory contains an index.php file (e.g. path/to/web/index.php).

composer.json

In your composer.json directory (which should be in the base directory of the repository) make sure to include the Heroku PHP buildpack.

{
  "require": {

  },
  "require-dev": {
    "heroku/heroku-buildpack-php": "*"
  }
}

If this statement was missing, then run composer update (./composer.phar update for me, because I downloaded composer and placed it in the base directory of my repository) so that Composer will fetch the package and install it into your vendor directory.

like image 66
Kayce Basques Avatar answered Nov 07 '22 03:11

Kayce Basques


the issue was with an incorrect/incomplete .git directory. Deleting the old one and recreating it (git init) solved the problem.

like image 2
Pallavi Singh Avatar answered Nov 07 '22 03:11

Pallavi Singh