Drupal is an open-sourced PHP-based content management system. It is very easy to extend and customize because of its modular structure.
Heroku is a great cloud hosting platform. At the beginning it only supported Ruby on Rails framework. Now it also supports PHP, NodeJS, Scala, Python, Java and Clojure. It is great because you can make a full-fledged live website in minute at zero cost.
Like with many other web applications, a machine which runs Linux operating system is preferred, and this post will assume you have knowledge of how to configure a local PHP environment. The tools you will use includes git, heroku toolbelt.
Without dragging anymore, here are the steps you need to do:
- Download newest drupal package from the official drupal site
- Extract the file
- Download Composer to the extracted folder
- Get a copy of sample php application from the Get Started with PHP on Heroku
- Copy composer.json and composer.lock in the sample app to your drupal folder
- Modify composer.json, delect default modules and add ext-gb and ext-mbstring module to require field
- Run php composer.phar update
- Run heroku create –http-git to make a new Heroku app
- Rename the new app by heroku apps:rename newname –app oldname
- Add heroku to git remote ropository by heroku git:remote -a yourapp (this step is only necessary when heroku complains it’s not a remote ropository)
- Run heroku addons:add heroku-postgresql:hobby-dev to add a PostgreSQL database
- Copy database.setting.php to setting.php in sites/default folder under your drupal folder
- Open you Heroku website, go to your new app, open database setting to see your database information
- Add database information found in last step to setting.php
- Use git push to deploy the site to heroku