I know this is old but I found this question while having a similar issue.
MAMP doesn’t ship with a bunch of the PHP sources
- Download MAMP components and configure
- URL: http://www.mamp.info/en/downloads/index.html (i.e. MAMP_components_2.0.2.zip)
- Unpack your MAMP_components_2.0.2.zip
- Identify your php-5.x.x.tar.gz file (where 5.x.x is your version of PHP)
- If you are using php > 5.4.10 then download the sources from http://php.net/releases as they are not in the MAMP components download (credit pulkitsinghal in comments)
-
Create directory for your PHP sources:
mkdir -vp /Applications/MAMP/bin/php5/include
-
Untar php-5.x.x.tar.gz into /Applications/MAMP/bin/php/php5.*/include or /Applications/MAMP/bin/php5/ include:
tar zxvf php-5.x.x.tar.gz -C /Applications/MAMP/bin/php/php5.?.??/include
-
Rename your php-5.x.x directory to php (without the version numbering):
mv /Applications/MAMP/bin/php/php5.2.17/include/php-5.?.?? /Applications/
MAMP/bin/php/php5.2.17/include/php -
Configure PHP sources (it’ll create necessary files i.e. zend_config.h, tsrm_config.h, etc.):
cd /Applications/MAMP/bin/php/php5.?.??/include/php
./configure
The process was for another fix but this resolved the issues with php.h not being found
Credit to where I found the answers – :
Thomas Hunter Blog
Google Doc detailing process