XDebug Install with XAMPP on Ubuntu

Friends this will cover Xdebug installation in 2 different way, you can choose as per your need

1.) Install XDebug for use with XAMPP on Ubuntu Linux.

2.) Install xDebug by apt-get install way.

Install XDebug for use with XAMPP on Ubuntu Linux.

Lets assume you have XAMPP installed with developer source code and header of XAMPP. If you don’t have XAMPP developer package installed you can install it by following…

Build Environment Setup

XDebug will need to be compiled. A couple of packages need to be in place before you can build the source.

1. Install the build-essential package to setup a basic build environment:

sudo apt-get update
sudo apt-get install build-essential

2. Download the development archive for your version of XAMPP and extract it over your existing installation (you may want to backup your XAMPP directory first):

sudo tar xvfz xampp-linux-devel-1.6.8a.tar.gz -C /opt

Build XDebug

wget http://www.xdebug.org/files/xdebug-2.0.3.tgz

tar xzf xdebug-2.0.3.tgz

cd xdebug-2.0.3/

phpize

After this you will have following output on your console…

Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
./configure

make

sudo make install

Then the output will be this.. please monitor the directory specified.

Installing shared extensions:     /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/

After the Xdebug extension is installed, you’re ready to enable and configure the extension.

First create a folder in your temp folder that will holds the data file generated by Xdebug

sudo mkdir /opt/lampp/tmp/xdebug

sudo chmod a+rwx -R /opt/lampp/tmp/xdebug

Open php.ini in a text editor, and add the following lines at the end.
( generally you will find it in /opt/lampp/etc/ )

;xDebug Configuration starts

zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so

xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.profiler_enable = On
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"

;xDebug Configuration ends

After adding the lines and verifying that your output directory is writable, restart your XAMPP server.

you can do it by  sudo /opt/lampp/lampp restart

and thats it..!! you have xDebug server running with apache..

Install xDebug by apt-get install way.

sudo apt-get install php5-xdebug

edit your php.ini file

In the end of the file, just add

xdebug.remote_enable=On
xdebug.remote_host=”localhost”
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”

If you are developing from another computer, we need to specify that ip address under xdebug.remote_host.

restart the server

sudo /opt/lampp/lampp restart