Santiago Lizardo - Technology entrepreneur

How to install PEAR and PHPUnit in Debian/Ubuntu

Date Tue Jun 14 00:00:00 UTC 2011

In general terms, it's very easy to install/upgrade new software in APT distros such as Debian/Ubuntu.

I don't want to say doing so for PHPUnit or PEAR is more difficult, but has a little, tricky part, upgrading PEAR. If you don't upgrade PEAR, PHPUnit will complain about an insufficient version and the installation will abort.


sudo apt-get install php-pear
sudo pear channel-update
sudo pear upgrade pear
sudo pear channel-discover
sudo pear channel-discover
sudo pear channel-discover

sudo pear install -a phpunit/PHPUnit

Additionally, if you want to include code coverage in your tests, you have to install the xdebug PHP extension.

sudo apt-get install php5-xdebug

Happy testing!

Keywords: php,pear,phpunit,debian,ubuntu,apt-get

comments powered by Disqus