
Installing and configuring xdebug in Ubuntu

Xdebug is a tool used to debug PHP scripts. It is used as an extension to get debugging information. To get more information about Xdebug go to http://xdebug.org .
Installing and configuring xdebug in Ubuntu is easier with inbuilt package available.
sudo apt-get install php5-xdebug
After successfully installing xdebug package in your server, you need configure xdebug to make it work. It is often done with the configuration file. Goto
sudo vim /etc/php5/mods-available/xdebug.ini
Add the following entries
zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler=dbgp
After adding the these entries just restart your webserver. If it is apache, just execute the following command.
sudo service apache2 restart
Now your PHP scripts are available for debugging. Use your favourite editor like Netbeans to debug the PHP scripting files . Netbeans displays all the debugging information provided by Xdebug.