Join Jon Peck for an in-depth discussion in this video Displaying variables with Xdebug, part of Advanced PHP: Debugging Techniques.
Xdebug replaces var_dump and var_export with its own version, which includes…different colors and highlighting for different types, limits on array elements…and object properties, a maximum depth to prevent infinite recursion problems,…and string length to reduce the chance of overloading the browser.…It's on by default, but is only enabled if PHP is configured to render error messages …as HTML, and HTML errors are off by default.…Return to the terminal then edit the PHP configuration again, …sudo nano -w /etc/php5/apache2/php.ini.…
Press Ctrl+W to search for HTML_ERRORS =.…Change its value to On.…Then exit and save, then restart the Web server.…Return to the browser and refresh.…Immediately, the difference will be noticeable and the notice, warning and fatal errors …are now displayed in a table.…
The trigger error functions are clickable, linking to the documentation on php.net.…Xdebug also adds an improved version of PHP's debug_zval_dump called…xdebug_debug_zval, which includes structured information about variables,…
This course covers installation of Xdebug on Apache as well as working with the NetBeans IDE (integrated development environment). Jon then introduces native web browser developer tools for Firefox and Chrome, and demonstrates browser independent web debugging tools. Best practices for debugging and profiling web application failures and performance issues are also covered.
- Configuring PHP error reporting
- Logging errors to file
- Gracefully handling fatal errors
- Installing Xdebug
- Understanding the principles of remote debugging
- Remote debugging with NetBeans
- Extending your browser with Firebug, FirePHP, or ChromePHP