Skip to content

4. Configuration Files

alex_prokopenko edited this page Dec 1, 2017 · 3 revisions

The root wp-config.php is required by WordPress and is mostly used to load the other main configs. In general case you don't need to edit wp-config.php file (however you will need this for multisite setup).

Main wp-config.php file loads Dotenv library and then take all main configuration from Environment variables. It defines some common constants, which users usually never touch.

For environment specific configuration, use the files under environments/. By default there are development, staging, and production but these can be whatever you require.

The environment configs are required before the main application config so anything in an environment config takes precedence over application.

Note: You can't re-define constants in PHP. So if you have a base setting in wp-config.php and want to override it in production.php for example, you have a few options:

  • Remove the base option and be sure to define it in every environment it's needed *Only define the constant in wp-config.php if it isn't already defined.

Next: Environment variables

Clone this wiki locally