Upgrading PEAR on Mac OSX Tiger

It’s annoying sometimes having to upgrade or install opensource applications on Mac OSX. Yes, it’s BSD Unix, but it’s not quite Linux when it comes to raw package management from command prompts and how some applications assume you are installing it on Linux. On my fresh install of Tiger, I was having some issues upgrade PEAR. Because it’s not really documented anywhere, here’s how I did it:

1. Follow the upgrade instruction on PEAR’s official website.

2. Once PEAR is upgraded, issuing

1
$: pear -V

from the command prompt should still give you an old version of PEAR as such:

1
PEAR Version: 1.3.6

3. To fix that, find out where the current version of PEAR is by issuing:

1
$: which pear

It should return:

1
$: /usr/bin/pear

4. Then find out where the upgraded PEAR went by issuing:

1
$: pear config-show

Look for:

1
PEAR executables directory   bin_dir

In my case, it resides in where PHP5 is at:

1
PEAR executables directory   bin_dir   /usr/local/php5/bin

5. Next I make a symbolic link to it from where

1
/usr/bin/pear

is:

1
2
$: mv /usr/bin/pear /usr/bin/pear.old
$: sudo ln -s /usr/local/php5/bin/pear pear

6. Do another

1
$: pear -V

and it should now show the proper version:

1
PEAR Version: 1.5.3