Quick and Easy Setup Wordpress on Heroku
Running Wordpress on Heroku sounds like no big deal, yet there are some caveats since Heroku is not your everyday FTP-Upload-99¢-PHP-Webhoster but a full-fledged PaaS provider for your grown-up web applications.
And yes… Wordpress can be at least the basis for such kind of applications. So let’s get started.
Step 1: Set up Repository
Deploying an app to heroku is done using Git. So create a new repository, either locally or at GitHub or Bitbucket, whatever you prefer.
Step 2: Download Wordpress
Download Wordpress form wordpress.org, unzip the archive into your Git repository, stage everything and commit.
Step 3: Create Heroku App with MySQL
If you don’t have a Heroku account yet, sign up for a free account.
Now create a new app and add a database. Wordpress runs only with a MySQL database, so using ClearDB addon is the best choice. The free Ignite plan is enough to start with.
Step 4: Config
You still need a wp-config.php
to enable Wordpress to connect to your database. Heroku holds the credentials for your database in an environment variable, so you can easily access it in PHP.
Copy the wp-config-sample.php
to wp-config.php
and replace the MySQL-Settings-part with this:
if(isset($_ENV[`CLEARDB_DAT…