Install Xdebug on Ubuntu

I always forget the little bit about error reporting, so here is a step by step guide to getting Xdebug running on you Ubuntu PHP installation.

1) Install PECL (if you don’t have it already)

> sudo apt-get install php-pear

2) Install Pear Xdebug extension

> sudo pecl install xdebug

3) Create a new config file and have it point at the new extension. Pay attention to the location of the extension in the above image. That is the path for this step.

> sudo nano /etc/php5/apache/conf.d/xdebug.ini

Add a line (if its not already there)




4) Now, edit the PHP ini file to change the following settings

display_errors = On


html_errors = On


Done, just restart apache and you should have nice var_dumps now