How to install PEAR on Mac OS X


Needing to use PEAR I stumbled upon a simple tutorial to install PEAR on Mac OS X by Jason McCreary.

Simply follow the three steps and you’ll be up and running!

  1. Download PEAR
  2. Configure and Install PEAR
  3. Verify PEAR

Download

Run the following bash commands

curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

Configure and Install

  1. Set the ”Installation base ($prefix)” to ”/usr/local/pear”.
    • Type 1 and press return.
    • Enter: /usr/local/pear
  2. Set the ”Binaries directory” to ”/usr/local/bin”
    • Type 4 and press return.
    • Enter: /usr/local/bin
  3. Finish the configuration by pressing return twice.

Verify

By running any pear command you should be able to verify if it works or not.

E.g.

$ pear version
PEAR Version: 1.9.4
PHP Version: 5.3.15
Zend Engine Version: 2.3.0
...