Menu Close

PHP’s Debug Mode Shall Be The Last Resort For Your WordPress Errors!

Phps-Debug-Mode

Debugging in PHP

PHP debugging can be done using various techniques and it can save your countless hours while coding. One of the most basic debugging technique is to simply turn on error reporting, but it is very effective. Another technique is little more advanced involving print statements, which can help pinpoint more exclusive bugs by displaying what is actually going onto the screen.

In this blog we will learn about error reporting debugging technique which will help you in solving various WordPress related problems.

Activating the PHP’s DEBUG Mode

To activate the PHP’s DEBUG Mode open wp-config.php and look for the line:

define(‘WP_DEBUG’, false);

What you need to do is to just add // before the line. (Technically we say that comment out the line)

Now your line looks as

// define(‘WP_DEBUG’, false);

Now what you need to add is

define(‘WP_DEBUG’, true);

define(‘WP_DEBUG_LOG’, false);

This will activate the information of PHP’s DEBUG. Now you won’t see “white screen” anymore. Now screen shows the errors in php code that are not allowing your website to work properly.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.