When I run phpunit
on the command line I get 'phpunit' is not recognized as an internal or external command, operable program or batch file.
php has been added to my system path.
My php.ini includes include_path=".;C:\PHP\pear"
.
How can I get the command phpunit to be recognized by the command line?
Make sure your PEAR installation is installed properly and available in the Windows environment. Each PEAR command has a corresponding .bat file in the PEAR installation directory, e.g. phpunit.bat. Because these are the files that get called when doing e.g. phpunit on the command line, this directory has to be on your PATH as well. Having the PEAR directory on the include_path only is not enough.
If you are sure PEAR is installed properly. reinstall PHPUnit with
pear install --alldeps --force phpunit/PHPUnit
You need to add php path (which is C:\PHP) to the PATH variable.
On Windows 7 it will be: 1) My Computer -> Right click -> Properties 2) Advanced System Settings 3) Click "Environment variables" button 4) Find "Path" entry in "System variable" section and: a) add to the end ";C:\PHP" (without quotes) or b) add to the front "C:\PHP;"
EDIT:
php has been added to my system path.
You do need to open a new windows command prompt (no need for logoff, restart...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With