Archive for July, 2013

PECL on OS X Mountain Lion: Quick and dirty

July 29th, 2013 by sjan

Yes, this is pretty simple, but I had to look around for too long to find a solution that didn’t involve homebrew or ports or (even worse) some kind of path manipulation to install PEAR/PECL to MAMP. (No, I do not want to set my bash_profile to use the MAMP PHP over the default. And no, I don’t want to recompile PHP – at least not today and at least not until I want to upgrade the version installed.) I just wanted to install pecl_http to run some tests, and I figured if I didn’t put my notes somewhere I would lose them. So here they are.

Before you begin, you need to have Xcode installed – get it from the app store.

Installing PEAR (which includes PECL) is pretty straight-forward (thanks to Jason McCreary at

Two simple terminal commands, and some configuration:

curl -O sudo php -d detect_unicode=0 go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

in the configuration prompt –
Type 1 and then Return
then type:

Type 4 and then return and type

Hit return and you are done (with the first part).

Verify pear with:
pear version

Now, before you run off and type sudo pecl install pecl_http you should know that it will fail, as autoconf is not yet installed. Thankfully, this is quite simple as well, (thanks to This question on

Download the latest release

Extract the files and do a normal ./configure; make; sudo make install;

Now you can
sudo pecl install pecl_http