PEAR Update Issues On Snow Leopard

Posted on October 9, 2009


So I just came across some weirdness on my default install of PHP on Snow Leopard. I wanted to install the latest version of PHPUnit in order to carry out some testing, but it was asking me to update PEAR.

So I ran the usual PEAR update command;

$ sudo pear upgrade pear

This appeared to run without any issues. But subsequently whenever I attempted to run PEAR I was greeted with the following error message;

/usr/local/bin/pear: fork: Resource temporarily unavailable

I took a look inside the offending file as it is just a simple command to run the PEAR script. It looked like this;

pear /usr/lib/php/pearcmd.php

Obviously the script was infinitely attempting to spawn itself causing the resource temporarily unavailable error. So the simple fix was to change the script to the following;

php /usr/lib/php/pearcmd.php $@

I’m not quite sure why the script changed when I upgraded but it appeared to. I figured I should pop this note up in case anyone else gets caught out, or indeed I forget and get caught out again. Any insight on why this might have happened would be appreciated.

Posted in: PHP