PHPUnit should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.
The PEAR channel (
is used to distribute PHPUnit needs to be registered with the local PEAR
pear channel-discover pear.phpunit.de
This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:
pear install phpunit/PHPUnit
Previous installations of the
PHPUnit2 packages from the
channel have to be uninstalled.
After the installation you can find the PHPUnit source files inside your
local PEAR directory; the path is usually
Although using the PEAR Installer is the only supported way to install PHPUnit, you can install PHPUnit manually. For manual installation, do the following:
Download a release archive from
and extract it to a directory that is listed in the
include_path of your
pear-phpunit script to
@php_bin@ string in it with the
path to your PHP command-line interpreter (usually
Copy it to a directory that is in your
and make it executable (
chmod +x phpunit).