I have spent a lot of time on this with no end product.
- Installed MAMP.
- Found "make" (was installed in different folder)
- Installed autoconf which was missing so I can run phpize
- Downloaded, compiled and installed xdebug according to:
http://www.xdebug.org/find-binary.php
- Made necessary changes to correct php.ini.
- Restarted MAMP - but phpinfo() does not show xdebug.
No matter what I do to the php.ini file located at /Applications/MAMP/conf/php5.3/php.ini, nothing changes. The site still loads fine. Even if I nuke it completely. Yet that is what phpinfo() shows it is loading.
What am I overlooking?
php.ini
[xdebug]
zend_extension=/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
The site where you can download precompiled binaries of xdebug had been down all morning (activestate) which is why I was trying to compile my own.
I just found out the site was back online, downloaded the xdebug.so file, and it is now loading.
I just did it and it worked. Here is what I did:
php -d detect_unicode=0 go-pear.phar
echo "export PATH=$PATH:/Users/the-user/pear/bin" >> .bash_profile
. .bash_profile
sudo pecl install xdebug
zend_extension
and uncomment the line if it is correct or change it if it is not (in my case it was correct)That's it. Unless you want to debug form IntelliJ Idea. In which case I had to copy /etc/php.ini.default to /etc/php.ini
have fun with PHP
Just to point out the obvious, but one that I keep throwing away time on; in an apache2 environment remember to restart apache2 for the changes to take effect.
Modern MACs have two kinds of binaries - 32-bit and 64-bit. Verify that you PHP matches your xdebug: do
file Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
thenfile /path/to/mamp/Library/modules/php5.3/libphp5.so
and see if they both showi386
orx86_64
.