Tuesday, 21 April 2009

How to install PEAR for MAMP in Mac OS X Leopard

in some cases running local instances of your website in mamp requires the use of the PEAR libraries which don’t come with MAMP. Here’s how I installed them.

curl http://pear.php.net/go-pear > go-pear.php
sudo php -q go-pear.php

Just press enter to select all the default choices except for the installation directory. For that, use /usr/local.
Next we need to modify our php.ini file to include the new PEAR files:

sudo cp /Applications/MAMP/conf/php5/php.ini /Applications/MAMP/conf/php5/php.ini.bak
sudo pico /Applications/MAMP/conf/php5/php.ini

and change

include_path = ".:/Applications/MAMP/bin/php/php5.5.3/lib/php

to read

include_path = ".:/Applications/MAMP/bin/php/php5.5.3/lib/php:/usr/local/bin/pear"

Restart Mamp and you’re almost done..  I required a few custom pear libraries that pear doesn’t install with by default.  here’s how i added mail support and xml support.

:>cd /usr/local/bin

:>pear list

:>sudo pear install --alldeps I18Nv2-0.11.4
 :>sudo pear install --alldeps mail
 :>sudo pear install --alldeps mail_mime
 :>sudo pear install --alldeps XML_RPC

No comments:

Post a Comment