Install latest XDebug for MAMP php
The installation of XDebug requires some additional steps to make it work:
- Change the local bash files to address the MAMP version of php.
- Download the same version of php that you want to use within MAMP from php.net and build it manually.
- Download XDebug and follow the installation instructions as provided by the XDebug website.
1. Adjust the bash files to address the MAMP php version
- in your Users-folder, add these lines to your .bashrc or .profile file (or any other dotfiles-setup)
# Depending on your setup, you might have to add a colon (:) before $PATH # PHP 5.6 #export PATH="/Applications/MAMP/bin/php/php5.6.7/bin$PATH" # PHP 5.5 #export PATH="/Applications/MAMP/bin/php/php5.5.23/bin$PATH" # PHP 5.4 export PATH="/Applications/MAMP/bin/php/php5.4.39/bin$PATH" # PHP 5.3 #export PATH="/Applications/MAMP/bin/php/php5.3.29/bin$PATH" # (continue similar for other version)
- Save it, re-start the Terminal and check via "which php", if the path to the MAMP php version is read correctly
2. Download php, copy it to the MAMP location into a new folder named "configure" and build it without iconv
- Download the same php version as you use in MAMP
- Go to /Application/MAMP/bin/
- Create a new folder called 'include'
- Copy the downloaded php-package of the same version into the include-folder and rename it to 'php' only (meaning you must get rid of the version number) resulting in a file structure like this: /Application/MAMP/bin//include/php/
- Open /Application/MAMP/bin//include/php/ in the Terminal
- Run "./configure --without-iconv" (maybe iconv works on your machine, it didn't on mine, so adding that flag helped to successfully .configure php)
- Run "make"
3. Follow along with the XDebug instructions
- Download the source of the latest XDebug from http://xdebug.org/download.php
- Unzip the package and cd into its nested folder (xdegub/xdebug-3.2.3/)
- Enter "php -i" and copy the output to http://xdebug.org/wizard.php; this will give you paths that are ready for copy&paste
- Run 'phpize' (make sue it comes from the MAMP php soure by entering "which phpize" into the Terminal); there might be some warnings, but if you read "build successful" in the end, you can safely ignore them)
- Run ./configure
- Run make
- Copy the "cp ..." path from the XDebug Wizard website and run it in the XDebug Terminal window
- Edit the php.ini file as described on the XDebug Wizard website
4. If you want to create the xdebug module for another MAMP php version, you would need to:
- change the path to the php version in question in the .bashrc or .profile file and restart the Terminal
- download the appropriate php version (move it to the proper 'include' location and build it)
- re-download xdebug (you can't use the one from before, because it is already configured for another php version)