Reputation: 16375
My question is similar as this one. But the answers to it don't help
The file I try to run is not an EXE file. It is phpunit in Laravel. When I am in the directory in works fine, but when I try to run it from a different directory it doesn't work.
"vendor/bin/phpunit"
"vendor/bin/phpunit" is not recognized as an internal or external command, operable program or batch file
Upvotes: 2
Views: 572
Reputation: 6133
I think you have to at least follow this and if not succefull comment in my asnwer and we can troubleshoot from that point further
Install PEAR, a dependency for PHPUnit:
A)Visit http://pear.php.net/go-pear.phar in your browser and save the file into your PHP directory. This is the folder where you can find php.exe.
B)Open an administrator command prompt. Hit your Windows key, type “cmd”, right-click the resulting “cmd.exe” search result, and select “Run as administrator”. Navigate to the folder where you have PHP installed, the same folder where you saved the file in the previous step.
C)Type the following command to execute the file you just downloaded: php go-pear.phar
D)After a moment, you should start being prompted for some things. The installer is pretty self-explanatory and I think you want a system installation rather than a local one.
E)Open the folder where PHP is installed and double-click the PEAR_ENV.reg file that has been created. This allows you to run the pear command from any folder.
F)Verify PEAR is working by running the command pear version
Install PHPUnit:
A)Turn on auto_discover in PEAR by typing the following command at the command line: pear config-set auto_discover 1
B)Download and install PHPUnit by running the following command: pear install pear.phpunit.de/PHPUnit
C)In order to be able to run the phpunit command from any folder, you need to add it to your Windows Path value. Right-click My Computer → Properties → Advanced system settings → Environmental Variables → select “Path” under “System Variables” → Edit → Add a semi-colon (;) and then the full path to your PHP folder onto the end of the value, for example like this: ;D:\Webserver\php
D)Verify PHPUnit is working by running the command phpunit --version
Taken from link
Upvotes: 2