Install PHPUnit in Windows, Wamp using PEAR


Go to the directory where PHP is located. Typically, this is <PATH-TO-YOUR-WAMP-INSTALLATION>\bin\php\php5.3.8

We’ll call this path “PHP’s location” throughout this article.

Now, install PEAR following instructions in this tutorial.

Open a command-prompt, go to PHP’s location using cd, and type:

pear channel-discover components.ez.no
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear install --alldeps phpunit/PHPUnit

We’re done! type phpunit –version to confirm installation.

Reference:

http://www.ankara-gtug.org/2011/11/15/phpunit-installation-on-wamp-in-windows-7-and-integration-with-eclipse-2/

Advertisements

10 thoughts on “Install PHPUnit in Windows, Wamp using PEAR

  1. Super instructions. One minor change, in final step. Change parameter switch in “pear install -alldeps phpunit/PHPunit” to “pear install –alldeps phpunit/PHPunit”.

    On the other hand, a person working with this will likely be capable of figuring it out.

    Thanks, and you saved me a LOT of time, both installing Pear and PHPunit.

    Miles

  2. I have tried running the above commands in command prompt, but i got the message like: “pear is not recognized as an internal or external command, operable program or batch file”. Hope I have installed PEAR correctly. But can’t figure out what is wrong.

  3. You need to run:
    pear channel-discover pear.symfony.com
    pear install –alldeps –force phpunit/PHPUnit

    The tutorial uses symfony-project which has version 1, phpunit needs version 2.

    Great tutorial on the whole though.

  4. don`t panic if not work(i think you know that i talk about///)
    try:pear channel-discover pear.symfony.com (it realy works);
    and: pear install symfony/YAML;
    then: pear install phpunit/PHPUnit;
    it must work`s!

  5. i ran the commands as listed without problems
    but when i type “phpunit –version” it is not recognized as a command
    where is phpunit installed?

    1. you run the -version command from \wamp\bin\php\php5.3.13 or similar. I followed the tutorial and then also followed Artem’s comments and it was installed. thanks all

  6. on channel discovery I keep getting PEAR_config::writeConfigFile fopen(‘C:\windows\pear.ini’,’w’) failed (fopen(C:\windows\pear..ini): failed to open stream: Permission Denied

Comments are closed.