Home › Forums › WordPress › Config Setup › Debug wp-config.php Settings
- This topic has 1 reply, 1 voice, and was last updated 7 years, 8 months ago by Layer7web.
Viewing 1 reply thread
-
AuthorPosts
-
-
August 14, 2016 at 11:48 am #2392
Layer7webKeymasterUseful debug settings for the wp-config.php file:
define(‘WP_DEBUG’, true); – Turn on warnings and notices.
define(‘WP_DEBUG_LOG’, true); – Log those warnings and notices to wp-content/debug.log
define(‘WP_DEBUG_DISPLAY’, false); – Don’t display them just log them to debug.log. (Publicly accessible if location is not changed)
To change the location of the debug.log file use this instead of WP_DEBUG_LOG:PHP12ini_set( 'log_errors', 1 );ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); -
March 19, 2017 at 8:47 pm #2697
Layer7webKeymasterTo use the same config file for different environments I have been using this a lot these days:
PHP1234567891011121314151617181920212223if(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’.
-
-
AuthorPosts
Viewing 1 reply thread
You must be logged in to reply to this topic.
Comments are closed.