简体   繁体   中英

Deploy PHP to Heroku

Since Heroku began Facebook integration awhile ago, I've wanted to deploy a few PHP files without having to use Facebook and just viewing my PHP on Heroku. This link here, Deploying Wordpress to Heroku simply states you can. But, I can't seem to figure out the PHP portion. I have a Rack app already built and tried some implementation that would just view PHP instead of HTML, and that didn't work. All it did is display static text. The same with just having a PHP file on the app in the /public folder, just displays static text. This has to work somehow since the link I shared works you through the process of getting Wordpress on Heroku. If anyone could, tell me how to get a few PHP files running on my Heroku app, I'd really appreciate it.

Thanks

You need to create your Heroku app on the new Cedar stack. Cedar stack apps reside on the domain herokuapp.com rather than heroku.com, so you'll know if you've got the right one. Then it's really as simple as pushing your PHP files. To create an app on the Cedar stack, use:

heroku create

Or, if you'd like to set a name, (ie myname.herokuapp.com) use:

heroku create myapp

For the benefit of others who are not as au fait with Git, you will also need to set up, commit and push your Git repository:

git init
git add .
git commit -m 'Initial commit'
git push heroku master

That's it! Good luck and have fun.

你不需要做任何事情 - 只需推动你的PHP代码并发生Heroku魔术 - 我不是PHP大师,但最近不得不部署一个PHP站点,我只是将代码推送到一个新的Cedar应用程序,没有更改目录结构等,它的工作原理。

Heroku现在有一个部署PHP的指南,Heroku上的PHP 入门 ,这解释了Heroku依赖于Composer

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