February 21, 2012

Install Xdebug 2.2 for PHP 5.4 on Gentoo Linux

Since some months ago, the PHP 5.4 release candidates are available in Gentoo's ~arch. But the Xdebug extension isn't available for this builds. I don't know the reasons for that, maybe due to the fact that Xdebug 2.2 isn't officially released at this time!? Whatever, the development version compiles with PHP 5.4 and this tutorial show how to get it working.

Compile

As first we clone the Github repository. If you follow the compile instructions in the README then you get an error message if you run the make command. So we must execute some additional commands to get this working. Well, now lets change into the xdebug directory and run the following commands to compile the source code.

Installation

If the extension has compiled successfully, it's time to install the extension into Gentoo's extension dir. To activate the extension for your PHP installation you must create an xdebug.ini in your PHP config directory. In this example, I will do this for the cli version of PHP 5.4. As last we change into the ext-active directory and create a symlink to our newly created xdebug.ini.

Testing

If you run the php -v command in your terminal, you should get the following output.

1 comment:

  1. Sad :(

    Made with yours suggestions. Bud cannot run with the same version 5.4rc8 on ubuntu 11.10 /x64

    Failed loading /usr/lib/extensions/no-debug-zts-20090626/xdebug.so: /usr/lib/extensions/no-debug-zts-20090626/xdebug.so: undefined symbol: output_globals_id

    ReplyDelete