I was so ready to get my hands dirty with this. Like most cases where I try to install a custom extension or php library, the directions may appear easy but it never quite goes so smoothly.
The xdebug installation guide suggests using PECL. One quick command later, it claims its ready to go, and all I have to do is update my php.ini file. But, not so fast! This is what did not work for me, so please jump below to find out what the problem was in case you run into any issues. This discusses compiling and installing xdebug 2.0.2 for PHP Version 5.2.5 (www.entropy.ch Release 6) on OS X 10.5.5 Macbook Pro 64-bit Intel Core 2 Duo. The key is 64-bit. This threw me for a loop!
~ > sudo pecl install xdebug Password: downloading xdebug-2.0.3.tgz ... Starting to download xdebug-2.0.3.tgz (286,325 bytes) ......................................................done: 286,325 bytes ... Build process completed successfully Installing '/usr/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so' install ok: channel://pecl.php.net/xdebug-2.0.3 configuration option "php_ini" is not set to php.ini location You should add "extension=xdebug.so" to php.ini </code>
So, next step is to modify the php.ini file as instructed. Let’s find out where it is. We can do this by using “php -i” like this:
~ > php -i
phpinfo()
PHP Version => 5.2.5
...
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/php5/lib
Loaded Configuration File => /usr/local/php5/lib/php.ini
Scan this dir for additional .ini files => /usr/local/php5/php.d
...
Now it’s time to edit /usr/local/php5/lib/php.ini. I use TextMate so I open up the file using the “mate” command.
~ > mate /usr/local/php5/lib/php.ini
And then I add
extension=/usr/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
Then, to confirm my changes have been made, using the command line interface for php (“CLI”) I use the “-m” flag:
~ >php -m PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so' - (null) in Unknown on line 0
Nooo! It was supposed to be so easy!!! So, an hour later after digging and searching I figured this out. First of all, PECL was installing the extension in the wrong place. It was going in /usr/lib/php/extensions/no-debug-non-zts-20060613/ and not where all of my other extensions were,
Configure: CFLAGS='-arch x86_64' ./configure --enable-xdebug
That line saved everything!!!
The final step, as you'll see in the designified post, is to add this to php.ini:
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so xdebug.file_link_format = "txmt://open?url=file://%f&line=%l"
The last line isn't necessary, but will use textmate to automatically open up references to files generated by xdebug, which is handy



