Installing PEAR on OS X Lion

Following Tyler Hall’s article ‚How To Install PEAR in Mac OS X Leopard‚, I managed to install PEAR on OS X Lion with a small modification. For PHP 5.3.6 you need a .phar PHP archive installer file.

1. Download the installer

curl > go-pear.php

2. Start the installation procedure with sudo

sudo php -q go-pear.php

3. Select a new installation base ($prefix) e.g. /usr/local/pear

4. If there is no /etc/php.ini file yet, copy the default

sudo cp /etc/php.ini.default /etc/php.ini

5. Edit /etc/php.ini and change the line

;include_path = ".:/php/includes"


include_path = ".:/usr/local/pear/share/pear"

6. Add /usr/local/pear/bin/ to your path, e.g. in .profile

7. Restart Apache