PHP Debugging Tools

By Avinash

September 16, 2011Tutorial5 Comments

PHP is very well used scripting language in now a days. But PHP does not have any inbuilt debugging tools or extension.

But we have some extensions and tools available which serves the debugging purpose of the PHP.

1) X-Debug

X-Debug is the most used and very useful PHP extension. X-Debug will show the variables on browser very well formmatted. You just have to use var_dump() for printing the variable.

X-Debug can also be integrated with the eclipse PDT for the maximum use of the X-Debug

For more information about X-Debug, please visit the official site of X-Debug.

2) Zend Debugger

Zend Debugger is also a well known debugger for PHP. Same X-Debug this can also be configured with the Eclipse PDT.

As far as I know, X-Debug and Zend Debugger can not be use together. Zend debugger will also come with Zend Studio.

For more information about Zend Debugger, Please visit the official site for Zend Debugger.

3) FirePHP

This is not the PHP extension. But this is the extension for the firefox. This firefox extension depends on the well known Fire Bug extension. With the use of FirePHP we can log the PHP variables in Firebug console panel.

Here is the sample code to log the variable in console.

FB::log("Log message"); FB::info("Info message"); FB::warn("Warn message"); FB::error("Error message");
 FB::log("Log message");
 FB::info("Info message");
 FB::warn("Warn message");
 FB::error("Error message");

Please check below image for look of the console tab of the Fire bug after executing the above code.

Official Web site.

4) PHP Console

Same as FirePHP, PHP Console is the extension for the Google Chrome. This is also log the PHP errors to console tab of the chrome plus it will also show the popup box in screen to notify the errors and warnings generated in PHP.

This extension uses the PHPConsole class and Lagger class. Please check below image which shows the notification popup and console logging in chrome.

Chrome Extension

Share This Article

  • raveren

    Here’s a simple and useful tool to replace var_dump:
    http://code.google.com/p/kint/

    • http://www.xpertdeveloper.com Avinash

      Hi raveren,

      Thanks for sharing… ;)

    • http://www.cuebit.co.uk Cue

      Beautiful!

  • Pingback: Outils de debugueur

  • Jason

    Thank you for sharing these debugging tools. I have been using PHP Console and I am satisfied with its features. I would definitely give the tools here a try and have fun with the comparison.