- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to enable error reporting
December 4, 2014
This tutorial will show you how to enable error reporting in WordPress.
WordPress. How to enable error reporting
If WP_DEBUG is enabled, all PHP errors, notices and warning messages will be displayed on your site. It is possible to modify the default behavior of PHP to make only fatal errors visible.
- WP_DEBUG
WP_DEBUG is a PHP constant, used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file:
-
WP_DEBUG_LOG is a companion to WP_DEBUG that makes all errors to be also saved to a debug.log file inside the /wp-content/ directory. This is useful if you want to review all notices later or need to view notices generated off-screen (e.g. during an AJAX request or running wp-cron). Please mind, if there are no errors or warnings, a debug.log file will not be created. Also, check files/folders permissions (644 – for files; 755 – for folders).
define('WP_DEBUG_LOG', true);
-
WP_DEBUG_DISPLAY is another companion to WP_DEBUG that controls whether debug messages are shown inside the HTML of pages or not. By default it is ‘true’ which shows errors and warnings as they are generated. Setting this to false will hide all errors. This should be used in conjunction with WP_DEBUG_LOG so that errors can be reviewed later.
define('WP_DEBUG_DISPLAY', false);
Feel free to check the detailed video tutorial below: