I globally installed PHPUnit 5.1 using the PHAR:

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit

Here's the message I get when I run phpunit --version:

This version of PHPUnit requires PHP 5.6; using the latest version of PHP is highly recommended.

I now realise PHPUnit 5.1 requires PHP 5.6 (14.04 has PHP up to 5.5.9 only). I'm using PHP 5.5.9 and don't want to upgrade to the next version.

How can I completely remove PHPUnit 5.1? My aim is to then use the old version of PHPUnit (4.8).

Ref: https://phpunit.de/manual/current/en/installation.html

1 Answer 1


You have moved (and renamed) only one file. For this reason

sudo rm -r /usr/local/bin/phpunit

Why -r? Because /usr/local/bin/phpunit could also be a folder.

  • wouldn't it be better sudo rm /usr/local/bin/phpunit/*
    – Parto
    Jan 15, 2016 at 8:10
  • I'm not sure /usr/local/bin/phpunit is a directory? Jan 15, 2016 at 14:08
  • Sorry, my bad, answer changed.
    – A.B.
    Jan 15, 2016 at 14:11
  • Now it's correct. Sorry.
    – A.B.
    Jan 15, 2016 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.