/dev-wp-config

Here's a dev configuration for wp-config based on Mark Jaquith's blog post at http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/

Primary LanguagePHP

Development wp-config.php setup for WordPress

Summary

A developer's setup for wp-config.php files that will accommodate:

  • Local development servers,
  • Staging database servers,
  • Production servers

Requirements

  • WordPress
  • At least two different environments.

How to Use

  1. Use this wp-config.php file instead of the default WordPress wp-config.php file. It contains the logic to determine which files settings to use.
  2. If you need to develop locally, copy/create a wp-config-local.php file and drop it in the WordPress install's root directory and configure database settings.
  3. If you have a staging site, copy/create a wp-config-staging.php file and drop it in the WordPress install and make sure there's no active wp-config-local.php file.
  4. If you're using git, or another version control system, include wp-config.php in your repository, but you'll probably want to ignore both 'wp-config-local.php' and 'wp-config-staging.php' if you're deploying from your repository.

Why should I use this?

Really, if you're asking, you probably shouldn't. If you're struggling with switching between local and staging environments, this may help.

With great power, comes great responsibility.

Version

  • 0.2.1 - Added wp-config-local.php to .gitignore, added JetPack to local dev
  • 0.2.0 - Updated filenames
  • 0.1.2 - Code tidying, shuffling, update docs
  • 0.1.1 - Renamed files to better mimic our setup
  • 0.1.0 - Initial release

Credits