Ubuntu: Installing Xdebug on Ubuntu LAMP

May 10, 2011 | In: Fatel Error, Ubuntu, web development

We are assuming that you have installed LAMP on your ubuntu operating system. But you are not getting errors in php files when file has any syntax or fatal error. So you see these errors by following below steps:

Open you php.ini file by below command:

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

First confirm your php.ini file location by phpinfo.

Search

display_errors = Off

and change this line by

display_errors = On and save and close.

Now,

restart your apache by below command:

sudo etc/init.d/apache2 restart

It will restart you apache server.

run below command to install Xdebug:

sudo apt-get install php5-xdebug php5-dev

It will install Xdebug on your Ubuntu system.

You can test this by following below steps:

1. Create a file naveenos.php file in var/www/

2. Write below content in the naveenos.php file
<?php

echo ‘naveenos group’

?>

3. Save this file. and run in the browser by http://naveenos.com.php

4. you will get error in color format.

 

That’s it.