Show WordPress Errors

In wp-config.php

If site is not live:

// define('WP_DEBUG', false);
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

For a live site better to log errors to a file:

@ini_set('error_log','problems.log'); // path to server-writable log file. set permissions to 666

Or according to the codex:

/* * This will log all errors notices and warnings to a file called debug.log in
* wp-content (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’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);

Leave a Comment