Monday, December 8, 2014

PHP debugging

There are a lot of ways available to debug the php. The one which i will suggest is firephp. Installation is very simple.

You will require following items to get it done.
1. firefox browser
2. firebug add-on extension
3. firephp extension
4. FIREPHP lib 


Steps:

1. Install latest firefox browser
2. Install firebug add-on in firefox browser. (You will see bug like icon on top-right corner in your firefox browser)
3. Now install firephp same way as firebug add-on.(When you click on firebug php icon, you will see in the opend window on top left corner two bug like icon. One is red-yellow for firebug setting and right to it is firephp. Sometimes this firephp icon will be displayed in blue color and sometimes it wont get displayed. But you can just over to the firebug icon in the opened window and on clicking on the space you will get the dropdown which contains firephp settings.)

To use these setting to debug php. First start your firebug php whenever you want to open php.

In your code you can add following lines.

require_once('FirePHPCore/FirePHP.class.php');
ob_start();
$firephp = FirePHP::getInstance(true);

ex. $firephp->log('testing code');
or $firephp->log($variableName,'variableValue');


Have happy debugging!!