• Categories

  • Archives

Installing PHPUnit On Windows With Out PEAR

This is a quick description of how I got PHPUnit working on Windows without installing PEAR

The PHPUnit documentation is a cryptic and sparse when describing how to install PHPUnit on windows.

I am assuming that PHP is already installed and working.


  1. Download the latest version of PHPUnit (currently 3.4.9) from here
  2. Extract to somewhere (I put it in my PHP directory)
  3. Edit the phpunit.bat file. At the bottom of the file there are two lines:
    set PHPBIN="@php_bin@"
    %PHPBIN% "@bin_dir@\phpunit" %*
  4. Change them to something like this:
    set PHPBIN="C:\Program Files (x86)\PHP\php.exe"
    %PHPBIN% "C:\Program Files (x86)\PHP\phpunit.php" %*
  5. To test if PHPUnit is working run “phpunit --help” from a command¬† prompt (PHP directory needs to be set in the path environment variable).