Wednesday 30 November 2016

WordPress Debugging with PHP Console


Those of you who are relatively familiar with Javascript will know just how useful the console.log feature can be. In a nutshell, it allows you to send debug information directly to your browser console (assuming that the browser you’re using supports a debug console). With PHP, it’s not so easy. Sure you can use breakpoint debug functions such as var_dump(), print_r(), and die(), but each of these will output the debug information directly onto your browser window, which is messy and often impractical.
If you’re using Google Chrome, PHP debugging gets a whole lot easier thanks to an extension called PHP Console. It allows you to display PHP errors and var dumps directly in the Chrome console as well as in notification popups. Even better, plugin author Fulvio Notarstefano has created a WordPress plugin implementation, so everything can be configured easily via a dashboard settings page on your site.
Below I’ll take you through how to setup and use PHP console debugging on your own WordPress sites:
Getting the extension and plugin
Add and activate the PHP Console extension from the Chrome Web Store here.
Download the WP PHP Console plugin here, and activate it
Source: https://managewp.org/articles/13922/wordpress-debugging-with-php-console




source https://williechiu40.wordpress.com/2016/11/30/wordpress-debugging-with-php-console/

No comments:

Post a Comment