How to configure XDebug in Ubuntu

In complex and large scale php application we need to debug the php code to easier life. Xdebug is a PHP extension which help us to debug applications.

This tutorial will shows how to configure Xdebug extension with NetBeans IDE in Ubuntu Linux.

I assume that in your ubuntu system, you have already installed php and configured LAMPP [ LINUX,Apache,MySQL,PHP]. so i start direct from configure the xdebug
This tutorial is tested on following configuration.

Apache 2.0
PHP Version 5.3.8
Netbeans 7.2.1
Ubuntu 12.04

step 1:
To install xdebug in ubuntu ,open terminal window and write following command. this command will install xdebug extension in ubuntu os.

sudo apt-get install php5-xdebug

step 2:
Edit php.ini write following command in terminal. so you can add xdebug configuration code.

sudo gedit /opt/lampp/etc/php.ini

and add following code at the bottom of the php.ini file

zend_extension = /usr/lib/php5/20090626+lfs/

step 3: you need to restart the apache server write following command. Click here if you want to see more commands Operate XAMPP
sudo /opt/lampp/lampp restart

step 4:
Now open brower and see localhost url (http://localhost/xampp/) and click on phpinfo() link to check that xdebug extension is configured successfully. if xdebug is install then it will looks like the following image.please see following image


step 5:

Finally open Netbeans IDE to add xdebug configuration .

Open Tools >> Options
click on “php” tab then click on “Debugging”

and write following configuration here.
Debugger Port : 9000
Session ID : netbeans-xdebug

see following images for above settings


Then click on ok button to save changes.
step 6: Thats it!! Now you can debug the php code in netbeans.
Enjoy Coding !!


10 thoughts on “How to configure XDebug in Ubuntu

  1. thank you very much. I able to configure xdebug with netbeans perfectly by following these steps. 🙂
    I appreciate this tutorials thanks again.

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s