You have started learning web designing and development. You have designed your first web app. Voila! But contrary to mobile apps, you need to host your web app on some server so that you can show off your impressive web app to others. Shelling out $5 a month on shared hosting for your first app doesn’t sound like a good idea. Enter Heroku!
Heroku is a PaaS, and if my memory serves me right, it may be the first PaaS offering too. For your first PHP app, Heroku may sound like a good option. With 512MB of RAM, 2TB bandwidth/month, and plenty more features, you wont have to think beyond Heroku. But even though most of its features are documented, you probably shall find less support for PHP from the open source community.
Though deploying your first PHP app on Heroku may sounds like child’s play, activating most of the features like gzip, caching static assets, setting expiry headers are quite a herculean task for someone quite inexperienced in this field. For someone well versed in Linux, git and compiling Apache and PHP from source, Heroku shall present itself as the best hosting option.
- Signup for a Heroku account
- Download and install Heroku Toolbelt. Git is already bundled along with it.
- Open up your command prompt, and navigate to your app folder using the cd command
- Login to Heroku, using heroku login. Enter your email address and password, and you shall be authenticated. Once you login, you need to create a ssh key.
- Once you complete that, type git init. It shall initialize your app folder with an empty git repo.
- Type git add .
- Type heroku create appname. Change appname to any name of your choice. If you want some random name, use the command heroku create
- Type git commit -m “Initial commit”
- Type git push heroku master
If you dont have an index.php file, it shall give an error. So better have an index.php in the root. With that, you have deployed your first PHP app!