mkdir ~/opt && cd ~/opt wget http://xdebug.org/files/xdebug-2.2.2.tgz tar -xzvf xdebug-2.2.2.tgz && cd xdebug-2.2.2/ phpize auto-apt run ./configure make sudo checkinstall sudo nano /etc/php5/mods-available/xdebug.ini sudo php5enmod xdebug php -i | grep xdebug
Explanation
- Create directory opt inside the home directory and change to created directory. Change directory name and location as needed
 - Get the latest version of Xdebug. Adjust URL to point to the latest or desired Xdebug version
 - Prepare the build environment for a PHP extension. See phpize manual.
 - Use auto-apt just in case there are missing dependencies. Not likely to happen in this case.
 - Build extension
 - Create and install deb package. For details see Checkinstall wiki.
 - The package documentation directory ./doc-pak does not exist.
 - Should I create a default set of package docs? [y]:
 - Type y
 - Please write a description for the package.
 - End your description with an empty line or EOF.
 - Enter Xdebug 2.2.2 or whatever might be suitable
 - This package will be built according to these values:
 - Options 0 to 13 listed
 - Enter a number to change any of them or press ENTER to continue:
 - Make changes as needed
 - Create extension configuration file. For details see Xdebug Documentation.
 - Enable extension
 - Check if extension is installed and configured
 
Basic extension configuration
zend_extension=/usr/lib/php5/20100525/xdebug.so
Prerequests
See Compiling Software wiki entry. Aside from basics php5-dev package must be installed on the system.