Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 2.49 KB

README.md

File metadata and controls

83 lines (60 loc) · 2.49 KB

How to setup WordPress 4.x on Heroku

This will set up a fresh WordPress install on Heroku with the newly released Heroku Buildpack for PHP.

  • nginx - Nginx for serving web content.
  • PHP - PHP-FPM for process management.
  • WordPress - Downloaded from the Github WordPress Repo.
  • MySQL - ClearDB for the MySQL backend.
  • Sendgrid - Sendgrid for the email backend.
  • MemCachier - MemCachier for the memcached backend.
  • New Relic- Monitoring

Getting started

Use the Deploy to Heroku button, or use the old fashioned way described below.

Deploy

Clone Project

  1. Clone this repository into a new directory.

  2. Create your Heroku app.

Note: application-name

heroku apps:create application-name --stack cedar --buildpack https://github.com/heroku/heroku-buildpack-php --region us

or on to add this buildpack to an existing app, run

heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
  1. Before you push to Heroku make sure to add the following add-ons.
heroku addons:add cleardb
heroku addons:add sendgrid
heroku addons:add memcachier
heroku addons:add papertrail
heroku addons:add newrelic
  1. Define your AWS keys for the AWS S3 Media Uploader plugin.
heroku config:set AWS_ACCESS_KEY_ID=123
heroku config:set AWS_SECRET_ACCESS_KEY=123

Some default configurations. WP_CACHE=true will enable Batcache with the Memcachier addon.

heroku config:set WP_ENV=prod
heroku config:set DISABLE_WP_CRON=true
heroku config:set WP_CACHE=true
  1. Deploy your WordPress site to Heroku.
git add .
git commit -am "Initial commit"
git push heroku master

Overview

└── public                 # Heroku webroot
    ├── content            # The wp-content directory. Renamed to content to avoid confusion with wp-content - and it looks prettier
    │   ├── plugins        # Plugins
    │   ├── mu-plugins     # Required plugins
    │   └── themes         # Your custom themes
    │
    └── wp                 # Where the actual WordPress install will be installed by Composer

Upgrade WordPress

Update the version number for the WordPress package in composer.json, then run composer update and commit the changes in composer.json and composer.lock. Do not upgrade WordPress from the admin-interface as it will not survive a restart or dyno change.