Skip to content

Instantly share code, notes, and snippets.

@boreal321
Created September 28, 2012 17:03
Show Gist options
  • Save boreal321/3800998 to your computer and use it in GitHub Desktop.
Save boreal321/3800998 to your computer and use it in GitHub Desktop.
debugging options for wp-config.php
/**
* Define where error logging will be written to.
*/
@ini_set('log_errors','On');
@ini_set('error_log','/path/to/logs/php_error.log');</code>
/**
* This will log all errors notices and warnings to a file called debug.log in
* wp-content only when WP_DEBUG is true. if Apache does not have write permission,
* you may need to create the file first and set the appropriate permissions (i.e. use 666).
*/
define('WP_DEBUG', false); // or false
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
}
/**
* The SAVEQUERIES definition saves the database queries to a array and that array can be
* displayed to help analyze those queries. The information saves each query, what
* function called it, and how long that query took to execute.
*
* Then in the footer of your theme put this:
if (current_user_can('administrator')){
global $wpdb;
echo "<pre>";
print_r($wpdb->queries);
echo "</pre>";
}
*
*/
define('SAVEQUERIES', false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment