Phpunit is launched from the command line. "phpunit" is not recognized as an internal or external command, operating program, or batch file. "

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 added to my system path. My php.ini includes include_path=".;C:\PHP\pear" .

How can I get the phpunit command to recognize on the command line?

+8
windows php windows-7 phpunit
source share
2 answers

Verify that the PEAR installation is installed correctly and is available on Windows Each PEAR command has a corresponding .bat file in the PEAR installation directory, for example. phpunit.bat. Because these are files called during execution, for example, phpunit on the command line, this directory should also be on your PATH. Having a PEAR directory in include_path is not enough.

If you are sure PEAR is installed correctly. reinstall PHPUnit with

 pear install --alldeps --force phpunit/PHPUnit 
+10
source share

You need to add the PHP path (which is C: \ PHP) to the PATH variable.

In Windows 7 it will be: 1) My computer → Right-click → Properties 2) Advanced system settings 3) Click the "Environment Variables" button 4) Find the entry "Path" in the "System Variable" section and: a) add to the end "; C: \ PHP" (without quotes) or b) add to the front "C: \ PHP;"

EDIT:

php added to my system path.

You do need to open a new command prompt window (no need to log out, restart ...)

+3
source share

All Articles