Install ‘xdebug’ PHP extension for XAMPP on linux

In my previous post I wrote about how we install XAMMP in the home directory of a user. We often need to profile our code and often on a variety of setups, the answer of course is to use Xdebug.

Following is the procedure for installing PHP's 'xdebug' extension for XAMPP on linux (most of the installation procedure is same as http://www.xdebug.com/docs/install but there are a few quirks).

  1. First you have to install XAMPP development package (http://www.apachefriends.org/en/xampp-linux.html) for your XAMPP installation. This package provides the necessary source files needed to compile the extra stuff
  2. Download 'xdebug' source from http://www.xdebug.com/ , uncompress it in a suitable directory, cd to that directory.
  3. Now run phpize
    CODE:
    1. [amit@amit xdebug-2.0.0RC4]$ /opt/lampp/bin/phpize

  4. Configure the extension
    CODE:
    1. [amit@amit xdebug-2.0.0RC4]$ ./configure --enable-xdebug --with-php-config=/opt/lampp/bin/php-config

  5. Run 'make' to get the compiled xdebug.so
    CODE:
    1. [amit@amit xdebug-2.0.0RC4]$ make

  6. Copy the xdebug.so file to PHP's extensions directory (you may need root privileges for this)
    CODE:
    1. [root@amit xdebug-2.0.0RC4]# cp modules/xdebug.so /opt/lampp/lib/php/extensions

  7. After that edit php.ini file and add
    CODE:
    1. zend_extension=/opt/lampp/lib/php/extensions/xdebug.so

  8. Lastly restart XAMPP and check phpinfo for Xdebug extension

I can't think of what can possibly go wrong with the above setup instructions but if it does, put in a comment and I can try to help


About this entry