With debugging turned on, it is much easier to locate any errors within your WordPress site as well as any plugins and themes that may be causing errors.
First, be sure that you are logged into cPanel. lo go to your local WordPress folder
Now that you are logged into cPanel, look for the icon that says File Manager and click on it.
Within your public_html directory, you will see a file labeled wp-config.php. Right-click on it, then click on Code Editor.
At the bottom of your wp-config.php file, add the following lines:
//Enable WP_DEBUG mode define( 'WP_DEBUG', true ); //display any errors caused by various PHP functions that are built into WordPress
define( 'WP_DEBUG_LOG', true );//allows you to write to /wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false );//controls whether debug messages are shown inside the HTML of pages or not
After you have edited the wp-config.php file, be sure to save your changes by clicking on the Save Changes button at the top right of the file manager.
WP_DEBUG is a PHP constant (a permanent global variable) that can be 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 on development copies of WordPress.
Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed. This is likely to modify the default behavior of PHP which only displays fatal errors and/or shows a white screen of death when errors are reached.
WP_DEBUG_LOG allows you to write to /wp-content/debug.log using PHP’s built in error_log() function, which can be useful for instance when debugging AJAX events.
WP_DEBUG_DISPLAY is another companion to WP_DEBUG that controls whether debug messages are shown inside the HTML of pages or not. The default is ‘true’ which shows errors and warnings as they are generated. Setting this to false will hide all errors.
Leave A Comment