Install xdebug for PHP5

To install the xdebug extension with PHP5 in Ubuntu follow those steps.

Run this command on your tarminal.

sudo apt-get install php5-xdebug

Update xdebug.ini :
Now we need to update the xdebug.ini file. Use the following command to open the file with gedit:

sudo gedit /etc/php5/apache2/conf.d/xdebug.ini

Change the file so it looks like this:

; configuration for php xdebug module
zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Restart Apache

Now restart apache with this command –

sudo /etc/init.d/apache2 restart

or

sudo service apache2 restart

Now if you check with phpinfo(). You should see the following text:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans
with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH

If you want to see the error with HTML format then you should change the two line on your php.ini file.

Open php.ini file with this command –

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

and find the two line and replace it.

display_errors = On
html_errors = On

That’s it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s