Unable To Install Phpunit Under Linux & Solution

For those of you following the book instructions on how to install phpunit under linux and if this command doesn’t work for you just like in my case:


pear install phpunit/PHPUnit

try to run the following:




pear channel-discover pear.symfony.com

pear install --alldeps pear.phpunit.de/PHPUnit



This solved it for me on CentOS 5x

I had similar problems with Debian 6. Pear alone was not enough. I had to install phpunit using apt-get:


sudo apt-get install phpunit

That resulted in a conflict somehow. After I updated Pear, and removed and reinstalled phpunit it suddenly worked.