Unlike previous version of OS X, Leopard doesn’t come with PHP’s PEAR repository installed by default. Luckily, installing is quick and painless.
From a command line:
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.)
Next we need to modify our php.ini file to include the new PEAR files:
sudo cp /etc/php.ini.default /etc/php.ini
Edit /etc/php.ini and change
;include_path = “.:/php/includes”
to read
include_path = “.:/usr/share/pear”
Restart Apache and you’re done!
[Adapted from http://clickontyler.com/blog/2008/01/how-to-install-pear-in-mac-os-x-leopard/]
October 20, 2008 at 10:04 am
Is this line correct? Seems like a hard paragraph break is missing:
curl http://pear.php.net/go-pear > go-pear.phpsudo php -q go-pear.php
October 22, 2008 at 7:58 pm
Yes, you’re are quite right – thank you. I’ve now corrected this.
March 9, 2009 at 4:09 pm
got a problem with the default install directories for PEAR – is installing to : /Users/me/PEAR /private/var/root/PEAR
.I’ve searched everywhere.. I just don’t get it!!
please help!