Enable WordPress debug mode

By default, WordPress debug mode is disabled. Error handling and display depends on the server settings. In most cases, this means that errors will not be displayed (even fatal errors), but they should be logged into the file (again, depends on server settings, and it can happen that logging of errors is disabled).

To enable WordPress debug mode, you need to add WP_DEBUG constant set to TRUE into wp-config.php file. Recently, wp-config.php has a definition for this constant included and set to FALSE. So, you need to have this line in your wp-config.php:

define('WP_DEBUG', true);

This will activate error reporting for all types of errors including strict and deprecated errors. There are two more debug constants that can be used if WP_DEBUG is active:

define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);

The first one will activate (or force) display of errors on the screen. The second one will activate logging errors into the file. This file will be debug.log in your wp-content folder.

For having debug mode active, but to only save debug information to log file, and not to display it on screen use this:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
Rate this article

You must be logged in to rate this.

0
0
856

Comments

Leave a Reply