Find the path to your MAMP php bin directory. This is usually located within the MAMP folder in Applications:
/Applications/MAMP/bin/php/phpx.x.x/bin
Open Terminal and export the PHP bin path:
export PATH=/Applications/MAMP/bin/php/phpx.x.x/bin:$PATH
Run the following command to verify PHP is installed correctly:
php -v
Download PHP source code and copy the source (contents of the archive) into the MAMP directory.
NOTE: You may need to create include/php directories if they don't exist. NOTE: Download the PHP source for the major and minor PHP version your targeting (e.g. 5.5.x).
/Applications/MAMP/bin/php/phpx.x.x/include/php
Configure the PHP source:
cd /Applications/MAMP/bin/php/phpx.x.x/include/php
./configure
Install Autoconf:
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xzf autoconf-latest.tar.gz
cd autoconf-*
./configure --prefix=/usr/local
make
sudo make install
Compile Phalcon:
mkdir -p ~/Build-Temp && cd ~/Build-Temp
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
Install the MongoDB PECL Extension: NOTE: Optional: Install only if you plan on using MongoDB.
sudo pecl install mongo
Open the PHP.ini file (MAMP Standard):
/Applications/MAMP/bin/php/phpx.x.x/conf/php.ini
Add the Phalcon and Mongo PECL to your php.ini under "; Extensions": NOTE: If you can't find where to reference these files, search for "extension=" in your php.ini file. NOTE: Only reference monogo.so if you installed the PECL extension.
extension=phalcon.so
extension=mongo.so