Building/Installing XDebug on Mac OSX with MAMP

I tried the above and i didn't quite work for me, so I Googled some more and here's what did the trick.

  1. Download and unpack the MAMP Components from SourceForge

  2. Make a note of the path(s) that were not found during the phpize process, for me it was:

    /Applications/MAMP/bin/php/php5.2.17/include/php/main/php.h
    
    /Applications/MAMP/bin/php/php5.2.17/include/php/Zend/zend_modules.h
    
    /Applications/MAMP/bin/php/php5.2.17/include/php/Zend/zend_extensions.h
    
  3. Create the required path in your MAMP php directory, again for me it was

    /include/php/
    
  4. Ensure the correct permissions on the directory

  5. Find the components for your target PHP version (in my case 5.2.17) and copy them into the path you created in step 3.

  6. Run the instructions for using the correct version of phpize from the Xdebug site

I hope that helps someone else as it took me waaaay too long to solve this!


After more research and trial and error i managed to install it after doing the following things:

  1. In Terminal, I ran chmod u+x /Applications/MAMP/bin/php/php5.4.3/bin/* To open execute permission on phpize and everything else in that path
  2. Following this article to install command line tools
  3. Following this article to install the latest autoconf and related tools
  4. After that following the steps provided by the XDebug Wizard worked without a hitch

This was a major headache though. Hopefully this answer will save someone else a bit of time in the future.


Had the same problem, but found a better solution

xDebug is already in MAMP.

Check your php.ini

/Applications/MAMP/conf/php5.x/php.ini

Go all the way down. You will see

[xdebug]
;zend_extension="/Applications/MAMP/bin/php5.X/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"

change that into

[xdebug]
zend_extension="/Applications/MAMP/bin/php5.X/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

Restart server... DONE!

See: https://web.archive.org/web/20151107210347/http://danpolant.com/want-to-run-xdebug-mamp-is-the-easiest-way/