In order to get PEAR working with MAMP run the following commands.
NOTE:
This may be obvious to some, but you should stop MAMP first. Otherwise you might get some strange errors.