Installing PEAR 1.9.2 with MAMP 1.9.1 and PHP 5.3.2 on Mac OSX 10.6
This was a lot harder than I think it should have been. I tried following the instructions on the following sites but despite saying that there was “nothing to upgrade” it was still saying version 1.9.0.
Using the “go-pear.php” method resulted in the following error:
and using the “pear upgrade pear” method resulted in
At one point I also got the amusing error message saying that it couldn’t upgrade to 1.9.1 because pear/Console_Getopt needed version 1.9.1 to install.
Finally (after installing it in the wrong place twice) I found this method which did work:
Installing Pear 1.9.2
1) Open a new terminal session.
2) Edit your .bash_profile:
so that it contains the following (add it under anything you already have).
3) Close terminal and re-open it then type
It should contain the new MAMP paths. If it doesn’t, something went wrong (make sure you’re in your home directory).
4) Check that you’re running the right PHP (i.e. the one included with MAMP, not the one included in OSX) by typing:
It should read:
5) If it says
then you need to either create a symlink to the MAMP version or delete it from here and update your path in your .bash_profile (see above ó†remember to restart terminal to start a new session).
I backed up the original Snow Leopard versions of PHP and Pear and then deleted them by doing the following:
1 2 3 4 5
6) Download pear.php.net/go-pear.phar to /Applications/MAMP/bin/php5.3/:
1 2 3
7) You’ll be asked to set the directories. You only need to set the first one and the rest will be correctly created. Choose “1” and then type:
8) It will then ask you if you want to update your php.ini. Type “Y” and hit enter.
Once it’s all installed, you’ll see a message saying that you have to update your $PATH variable. If you haven’t already (see step 1), do this now then restart Terminal.
9) Type pear -V and it should now be 1.9.2.
You can then install all the packages you like. Remember that PHPUnit is now on its own channel and you’ll have to make pear aware of that new channel by running