Home › Forums › WordPress › Config Setup › Debug wp-config.php Settings › Reply To: Debug wp-config.php Settings
March 19, 2017 at 8:47 pm
#2697
Layer7web
Keymaster
To use the same config file for different environments I have been using this a lot these days:
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
if(strpos($_SERVER['HTTP_HOST'], 'local') === false){ define('DB_NAME', 'database_name'); define('DB_USER', 'username'); define('DB_PASSWORD', 'password'); define('WP_DEBUG', false); /** WP Memory Limit */ define('WP_MEMORY_LIMIT', '1024M'); /** Limit number of post revisions */ define( 'WP_POST_REVISIONS', 5); /** Turn Off PHP Error Reporting */ error_reporting(0); @ini_set(‘display_errors’, 0); } if(strpos($_SERVER['HTTP_HOST'], 'local') >= 0){ define('DB_NAME', 'database_name'); define('DB_USER', 'user_name'); define('DB_PASSWORD', 'password'); define('WP_DEBUG', true); } |
Putting development connection settings in the ‘local’ and live settings in the not ‘local’.
Comments are closed.