简体   繁体   中英

I can't deploy my php app to Heroku

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 git@heroku.com:abcfirstapp.git
git push heroku master

And I got the error like

Heroku push rejected, no Cedar--supported app detected To git@heroku.com:abcfirstapp.git [remote.rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com: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

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

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 .

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

需要的是至少一个空的composer.json推送这个,然后重新部署

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM