2

This is the first time I get in touch with Heroku (it's really amazing). I followed these steps to deploy my very first app to heroku.

git init
git add .
git commit -m 'first commit'
heroku create abcfirstapp
git remote add origin [email protected]:abcfirstapp.git
git push heroku master

And I got the error like

Heroku push rejected, no Cedar--supported app detected To [email protected]:abcfirstapp.git [remote.rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:abcfirstapp.git'

I'm quite sure that my php file is written probably since it runs well with my local xampp server

<?PHP phpinfo(); ?>

One more problem is: when I try to pull from heroku using

git pull heroku master

I got an error

fatal: couldn't find remote ref master

Could anyone help me out please?

Thanks

4 Answers 4

5

The default PHP buildpack detects PHP apps by looking for index.php in the repo root. Do you have one of those?

Alternatively, you can hardcode the buildpack:

heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
2
  • hi, it's really helpful. Btw, can you explain to me the purpose of having the index.php and how the index.php looks like.
    – Toby D
    May 20, 2013 at 23:11
  • When Heroku gets your app source code, it has to decide what buildpack to use when building your app slug (i.e. Ruby, Python, something else). To detect whether to use the PHP buildpack (which is what you want), it looks for the existence of a file called index.php since most PHP apps will tend to have that.
    – friism
    May 20, 2013 at 23:51
2

no Cedar--supported app detected

PHP is not a natively supported language on Heroku, outside of Facebook apps I suppose. You'll need to utilize something like a Third Party Buildpack.

0

It looks like the docs (Apr 2015) recommend you set a custom buildpack via:

heroku buildpack:set https://github.com/heroku/heroku-buildpack-php

https://devcenter.heroku.com/articles/buildpacks

0
0

What is required is at least an empty composer.json push this, and re-deploy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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