Install php xdebug profiler on ubuntu

By | April 7, 2010

Install Xdebug

Install the packages from synaptic package manager

sudo apt-get install php5-dev php5-xdebug

Configure php to use xdebug extension

Locate the path to xdebug.so file

martin@martin-dev:/$ find / -name 'xdebug.so' 2> /dev/null
/usr/lib/php5/20060613/xdebug.so

An alternative command to find the xdebug.so file is using dpkg and grep as follows

$ dpkg -L php5-xdebug | grep xdebug.so
/usr/lib/php5/20100525/xdebug.so

Now edit the php.ini configuration file as follows :

sudo gedit /etc/php/apache2/php.ini

Add the following line at the end :

zend_extension="/usr/lib/php5/20060613/xdebug.so"

To enable profiling add :

xdebug.profiler_enable = 1

Now restart Apache for new php settings to take effect.

$ sudo service apache2 restart

Install kcachegrind

Resources

http://xdebug.org/docs/
About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *