PHP and WordPress: Debugging PHP and WordPress: Debugging wordpress wordpress

PHP and WordPress: Debugging


Pear Debug Wordpress plugin: http://wordpress.org/extend/plugins/wp-pear-debug/

Update 4/08/2015: The above plugin hasn't been updated in a few years. You can also use the built-in WordPress PHP debugging functions in wp-config.php , i.e.:

  // Enable WP_DEBUG modedefine('WP_DEBUG', true);// Enable Debug logging to the /wp-content/debug.log filedefine('WP_DEBUG_LOG', true);// Disable display of errors and warnings define('WP_DEBUG_DISPLAY', false);@ini_set('display_errors',0);// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)define('SCRIPT_DEBUG', true);

See https://codex.wordpress.org/Debugging_in_WordPress for the complete docs


There's (more than one/) a way to enable "a 'debug mode'" for php in general. And that's installing a debugger extension like e.g. xdebug.
You need a client that connects to the debugger and retrieves+displays the information.
Netbeans 6.7 has been released and its php module supports xdebug. It has become a nice IDE for PHP development.


I know this has long been answered, but if you define('WP_DEBUG',true); in your wp-config.php and are still not seeing errors, then add this code right after the define statement:

if (WP_DEBUG) ini_set('display_errors',1);