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
Step 5 should be php -v PHP
Step 5 should be
php -v
PHP 5.3.6-13ubuntu3.3 with Suhosin-Patch (cli) (built: Dec 13 2011 18:37:10)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans