Problems with PHPUnit (Linux) - PHP Fatal Error Problems with PHPUnit (Linux) - PHP Fatal Error linux linux

Problems with PHPUnit (Linux) - PHP Fatal Error


Problem solved.

Follow @David Harkness comment I tried to install PHP_CodeCoverage and then I realized that my PEAR Installer is too old. I Upgraded it to 1.9.2 and then reinstalled PHPUnit.

$ wget http://pear.php.net/go-pear.phar$ php go-pear.phar$ pear install phpunit/PHPUnit

What's quite strange because all software was freshly installed week ago.

Answer. How I installed PHPUnit finally.

sudo pear channel-discover pear.phpunit.desudo pear channel-discover components.ez.nosudo pear channel-discover pear.symfony-project.comsudo pear install phpunit/PHP_CodeCoveragesudo pear install phpunit/PHPUnit

If You still have problems try to update PEAR:

sudo wget http://pear.php.net/go-pear.pharsudo php go-pear.phar


  1. configure channel autodiscovery

    sudo pear config-set auto_discover 1

  2. simply upgrade / install phpunit with --alldeps flag enabled

    sudo pear upgrade --alldeps channel://pear.phpunit.de/PHPUnit

and it automatically does the necessary magics. :)

Update:http://pear.phpunit.de/ has gone away (Returns 410)


The other solutions here did not work for me. I finally found a solution that worked for me here:http://markojakic.net/configure-phpunit-and-pear-in-ubuntu-12-04

Essentially pear by default for me was installing binaries to my home directory. To fix it I ran the following commands

sudo pear config-set bin_dir /usr/binsudo pear config-set doc_dir /usr/share/php/docsudo pear config-set php_dir /usr/share/phpsudo pear config-set cfg_dir /usr/share/php/cfg (make (sudo mkdir cfg) directory here)sudo pear config-set data_dir /usr/share/php/datasudo pear config-set test_dir /usr/share/php/testsudo pear uninstall phpunit/PHPUnitsudo pear install phpunit/PHPUnit