Installing xdebug on Ubunt 10.x or Ubuntu 11.x

Installing xdebug on Ubuntu 10 or above is very easy.

1. Install php5-xdebug

$ sudo apt-get install php5-xdebug

2. Find where xdebug.so is installed

$ sudo updatedb
$ locate xdebug.so
/usr/lib/php5/20090626+lfs/xdebug.so

3. Edit xdebug.ini file

$ sudo vi /etc/php5/apache2/conf.d/xdebug.ini

and make it look like the following

; configuration for php xdebug module
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

4. Restart the server

$ sudo /etc/init.d/apache2 restart

5. Verify that the xdebug is running

$ sudo /etc/init.d/apache2 restart

If you run phpinfo(), you should see the following text

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans