2025

6 thoughts on “Install PHPUnit On Wamp / Xamp Manually without Pear

  1. Hi there,

    I think the problem is with the path settings.
    PHP is not able to find the included files in the include file path specified.

    Check below settings-

    I think #2 requires to be configured in your php.ini file.

    Make sure you have “phpunit.bat” at “C:\PHP\” path.

    In your php.ini in PHP folder make sure you have phpunit path is set something as (as per your system)- include_path = “.;C:\php\includes\PHPUnit-3.2.0”

    My setting is-
    include_path = “.;C:\wamp\bin\php\php5.2.9-2\includes;C:\wamp\www\testphpunit\PHPUnit-3.2.0;C:\wamp\bin\php\php5.2.9-2\includes\PHPUnit-3.2.0”

    Hope this helps.

  2. Dear all,
    I try above steps so many times and the following problems occurs, please help
    Thanks a lot

    D:\PHPProject\ASSET\test>phpunit – -version
    PHP Warning: require_once(PHPUnit/TextUI/TestRunner.php): failed to open stream
    : No such file or directory in C:\PHP\includes\PHPUnit-3.3.17\PHPUnit\TextUI\Com
    mand.php on line 48

    Warning: require_once(PHPUnit/TextUI/TestRunner.php): failed to open stream: No
    such file or directory in C:\PHP\includes\PHPUnit-3.3.17\PHPUnit\TextUI\Command.
    php on line 48
    PHP Fatal error: require_once(): Failed opening required ‘PHPUnit/TextUI/TestRu
    nner.php’ (include_path=’.;c:/php/includes/’) in C:\PHP\includes\PHPUnit-3.3.17\
    PHPUnit\TextUI\Command.php on line 48

    Fatal error: require_once(): Failed opening required ‘PHPUnit/TextUI/TestRunner.
    php’ (include_path=’.;c:/php/includes/’) in C:\PHP\includes\PHPUnit-3.3.17\PHPUn
    it\TextUI\Command.php on line 48

    D:\PHPProject\ASSET\test>

  3. the bat file is now like this:
    if “%PHPBIN%” == “” set PHPBIN=@php_bin@
    if not exist “%PHPBIN%” if “%PHP_PEAR_PHP_BIN%” neq “” goto USE_PEAR_PATH
    GOTO RUN
    :USE_PEAR_PATH
    set PHPBIN=%PHP_PEAR_PHP_BIN%
    :RUN
    “%PHPBIN%” “@bin_dir@\phpunit” %*

    what changes am i need to make?

  4. Hey Garry —

    Forgot to stop back in and say ‘thanks’ after I got phpunit working with a manual install on xp x64.

    Followed alot of different tuts tryihg to get PhpUnit up and running, but it was your bat file command that finally did the trick.

    Thanks much for posting this.

    Dan

  5. Hey Dan,

    I am attaching the screen shot and also phpunit.bat for download.

    Let me know if you face any other problems. The very first thing is get your PHP to be executed by command line.

  6. garyy –
    tnx for the great article on this. I am struggling to install phpunit w/o pear on windows.

    Q: In tsill a bit confused by step 11. Is that whole string…

    “PHPBIN=”C:\wamp\bin\php\php5.2.9-2\php.exe” “C:\wamp\bin\php\php5.2.9-2\php.exe” -dsafe_mode=Off “C:/wamp/bin/php/php5.2.9-2/includes/PHPUnit-3.2.0/PHPUnit/TextUI/Command.php” %*”

    ..on one single line in the .bat file?

    (or maybe could you just post an screenshot of your finalized .bat file? That would make it totally clear)

    tnx for your tut. Good stuff.

    Dan

Comments are closed.