I am assuming the reader already has LAMPP setup and running on their Linux. First step towards setting up xdebug is to download LAMPP development package add-on from the apache-friends website. After the compressed file is download navigate to the folder where the TAR file is located using linux terminal and the type in -
export PATH=/opt/lampp/bin:$PATH
sudo tar xvfz xampp-linux-devel-1.7.4.tar.gz -C /opt
The above overwrites the existing LAMPP setup and includes the add-ons. After the files are overwritten, type in the following command.
/opt/lampp/bin/pecl update-channels
The above updates the PECL channels and prepares it for PECL based xdebug installation. After the above line is executed type-in:
/opt/lampp/bin/pecl install Xdebug
The above line sets up Xdebug in the existing LAMPP setup and at the 3rd or 4th last line of you will see the location of the xdebug.so files location given, note it down. The location may look something similar to this – “/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so”
Now we have to update the php.ini file to include the xdebug settings. You will find the file in “opt/lampp/etc/” open it by typing -
sudo gedit opt/lampp/etc/php.ini
Add the following lines at the very end of the file and save it.
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”
After the file is saved restart LAMPP by typing in -
sudo opt/lampp/lampp restart
To verify goto http://localhost/ after the server is restarted and you will see Xdebug table showing the xdebug settings.
let me know if you come across any issues during the setup process.
~ thephpx