Install Xdebug

1
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:

1
<code>sudo gedit /etc/php5/apache2/conf.d/xdebug.ini</code>

Change the file so it looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
<code>; 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</code>

Restart Apache
All left to do now is restart Apache with the following command:

1
<code>sudo /etc/init.d/apache2 restart</code>

Now you can check if all is OK 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

Share this post

3 Comments

  1. Simple and Easy thanks. Now to try and get MacGDBp using it.

    June 20, 2011
  2. wrt54gl

    Thanks for this. It is nice that there is finally an apt-get package for this.

    November 26, 2011
  3. [...] Xdebug Installation: http://scottfaisal.com/installing-xdebug-on-ubuntu-10-04/ [...]

    December 6, 2011

Leave a Reply