Ubuntu / How to install xdebug

Here is a mini-howto in how to install the xdebug extension with PHP5 in Ubuntu.
This will install xdebug 2.0 (or whatever is latest version in PEAR repository when you try this).
It is assumed you have Apache2 + PHP5 working already.

Code:
sudo apt-get install php5-dev php-pear
Now install xdebug through PECL.

Code:
sudo pecl install xdebug
Now we need to find where xdebug.so went (the compiled module)
Code:
martin@martin-dev:/$ find / -name 'xdebug.so' 2> /dev/null
/usr/lib/php5/20060613/xdebug.so
Then edit php.ini:

Code:
sudo gedit /etc/php/apache2/php.ini
Add the following line:

Code:
zend_extension="/usr/lib/php5/20060613/xdebug.so"
Then restart apache for changes to take effect

Code:
sudo /etc/init.d/apache2 restart
Check phpinfo() to make sure the extension is loaded correctly. The following line should have been appended to the copyright lines:
with Xdebug v2.0.0, Copyright (c) 2002, ..., 2007, by Derick Rethans
For more information about xdebug configuration and usage, please read the official documentation, found here: http://xdebug.org/docs/

Author of the original manual is unknown.

No comments:

Post a Comment