MAMP PRO Pear Installation

In MAMP PRO you have various php versions php5.2.17 and php5.3.6. You can use either for this routine.

1. Turn on PEAR auto discover

/Applications/MAMP/bin/php/phpX.X.XX/bin/pear config-set auto_discover 1

If you get an error about your config file, simply delete:

/Applications/MAMP/bin/php/phpX.X.XX/conf/pear.conf

2. Update pear

cd /Applications/MAMP/bin/php/phpX.X.XX/bin
sudo ./pear upgrade pear

INSTALL PHPUNIT

3. Install PHPUnit from pear.phpunit.de

/Applications/MAMP/bin/php/phpX.X.XX/bin/pear install pear.phpunit.de/PHPUnit

This will install PHPUnit under

/Applications/MAMP/bin/php/phpX.X.XX/bin/phpunit

If done right the phpunit file should already contain reference to the MAMP’s php you are choosing to use, now to have phpunit available on your system as a command you can do something similar to this:

sudo ln -s /Applications/MAMP/bin/php/phpX.X.XX/bin/phpunit /usr/local/bin/phpunit

INSTALL MaxMind GeoIP

5. Install MaxMind GeoIP

/Applications/MAMP/bin/php/php5.2.17/bin/pear install Net_GeoIP

REFERENCES:

One Reply to “MAMP PRO Pear Installation”

  1. Ideas on how to get past this error (step 2):

    $ sudo ./pear upgrade pear

    Could not get contents of package “/Applications/MAMP/bin/php5.3/bin/pear”. Invalid tgz file.

    upgrade failed

    // download the appropriate pear package tgz manually?

Comments are closed.