Creating / Installing XDebug on Mac OSX Using MAMP

I am having trouble creating / installing XDebug on Mac OSX using MAMP.

I have searched the Internet so far, and for now I am stuck on the XDebug part of the “Installation Wizard” that tells me “Run: phpize” in the source code that I downloaded.

When I started phpize , I get the following message:

 new-host-2:xdebug-2.2.0 Dima$ phpize grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version: Zend Module Api No: Zend Extension Api No: Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. 

If I do a which phpize , I get:

 new-host-2:xdebug-2.2.0 Dima$ which phpize /usr/bin/phpize 

This is not the version I want to use, I want to use the installed version of MAMP phpize , I assume, since I want to install XDebug on the PHP version of MAMP. This is perplexing because I added the MAMP-specific bin path for my .bash_profile to the $PATH variable already.

If I run echo $PATH , I get:

 new-host-2:xdebug-2.2.0 Dima$ echo $PATH /opt/local/bin:/opt/local/sbin:/Applications/MAMP/bin/php/php5.4.3/bin:/Users/Dima/.rvm/gems/ruby-1.9.2-p290/bin:/Users/Dima/.rvm/gems/ ruby-1.9.2-p290@global /bin:/Users/Dima/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/Dima/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin 

The specific MAMP PHP path appears in front of '/ usr / bin'. The next thing I tried is to run the MAMP phpize specification, providing it all the way manually:

 new-host-2:xdebug-2.2.0 Dima$ /Applications/MAMP/bin/php/php5.4.3/bin/phpize -bash: /Applications/MAMP/bin/php/php5.4.3/bin/phpize: Permission denied 

Now I checked the permissions of these files in the Finder, and it shows that I have full permission to read and write files from this folder. I lost a little. Any help would be greatly appreciated. I can post more information if it would be helpful to diagnose this problem.

+7
source share
4 answers

After additional research and testing and errors, I was able to install it after performing the following steps:

  • In the terminal, I ran chmod u+x /Applications/MAMP/bin/php/php5.4.3/bin/* To open execution permission on phpize and everything else in that path
  • Follow this article to install command line tools.
  • Following this article , install the latest version of autoconf and related tools.
  • After that, following the steps provided by the XDebug Wizard , it worked without a hitch.

It was a serious headache. Hopefully this answer will save someone a little more in the future.

+3
source

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 it to

 [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 

Restarting the server ... DONE!

http://danpolant.com/want-to-run-xdebug-mamp-is-the-easiest-way/

+11
source

I tried the above, and I didn’t work very well for me, so I searched Google again and this is what the trick did.

  • Download and unzip MAMP Components from SourceForge

  • Write down 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 
  • Create the necessary path in your php MAMP directory, for me it was

     /include/php/ 
  • Ensure the correct permissions for the directory

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

  • Run instructions for using the correct phpize version from the Xdebug website

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

+8
source

easily in the directory C: \ MAMP \ conf \ php xxx \ and open everything related to php.ini and then just put these lines in php.ini

  [xdebug] xdebug.default_enable=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_autostart=1 zend_extension="C:\MAMP\bin\php\php5.5.0\ext\php_xdebug.dll" 
0
source

All Articles