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 xdebug.so 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)

zend_extension=

I.e.

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so

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

display_errors = On

and,

html_errors = On

 

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

By admin

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.