- Find the path to your MAMP PHP bin directory. This is located in the MAMP folder within the Applications directory.
/Applications/MAMP/bin/php/phpx.x.x/bin
- Open Terminal and run the following command.
- Note: Replace phpx.x.x with the version you're targeting (e.g. php5.5.10).
export PATH=/Applications/MAMP/bin/php/phpx.x.x/bin:$PATH
- Run the following command(s) inside of the terminal to verify PHP is installed correctly.
php -v
- Download PHP source code and copy the source (contents of the archive) into the following 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).
- Note: Replace phpx.x.x with the version you're targeting (e.g. php5.5.10).
/Applications/MAMP/bin/php/phpx.x.x/include/php
- Run the following command(s) inside of the terminal to configure the download PHP source.
- Note: Replace phpx.x.x with the version you're targeting (e.g. php5.5.10).
cd /Applications/MAMP/bin/php/phpx.x.x/include/php
./configure
- Run the following command(s) inside of the terminal to install Autoconf.
mkdir -p ~/Build-Temp && cd ~/Build-Temp
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
- Run the following command(s) inside of the terminal to compile Phalcon.
mkdir -p ~/Build-Temp && cd ~/Build-Temp
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
- Run the following command(s) inside of the terminal to install the MongoDB PECL extension.
- 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
- Reference Phalcon and MongoDB extensions inside of your php.ini file.
- 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