PHPUnit require_once(PHP/CodeCoverage… Error on Ubuntu

PHP Logo
When trying to install PHPUnit on Ubuntu 11.10, I received the following error:

PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38

After some serching, I found the answer was to upgrade my version of pear and then reinstall phpUnit using the Pear installer.

The following commands should fix the problem:
1. Upgrade Pear:

sudo pear upgrade PEAR

2. Install PHPUnit:

sudo pear config-set auto discover 1;
sudo pear install pear.phpunit.de/PHPUnit

Thanks to the PHPUnit website for the answer.

This entry was posted in PHP and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>