Can’t install PHPUnit via PEAR, requires PEAR Installer >= 1.9.2, can’t upgrade PEAR from 1.9.0

You basically have 2 pear installations on your machine, and the “pear upgrade” command updates the other one, not itself.

I assume that the pear version you’re running has been installed via ubuntu’s apt.

Find out where it has been installed with apt (on Debian/Ubuntu):

$ dpkg -L php-pear
...
/usr/share/php/PEAR.php
...
/usr/bin/pear

Now let’s see where pear installs the files to:

$ pear config-get php_dir
/usr/share/php

On my machine, it is the same – but probably not on yours, which is the problem. Fix it by setting the php_dir, as well as the bin_dir:

$ pear config-set php_dir /usr/share/php
$ pear config-set bin_dir /usr/bin

Alternatively, remove the ubuntu pear and install it freshly from http://pear.php.net/go-pear.phar

Leave a Comment