7

I've attempted to install PHPUnit on a windows 2008 server with IIS and I've followed the instructions on the PHPUnit site in terms of manually creating a batch file and setting the environment variable however, when I try checking the installation in CMD.exe

phpunit --version

I'm getting the "Could not open input file: *" error message. However, when I run

php phpunit.phar --version 

it correctly gives me the version number. I need to know what's causing the error incase it's anything i've potentially done during the installation that's caused it. To confirm the directory has been listed within the system path variable.

3 Answers 3

19

Remove the version in the phar filename (ex. from phpunit-5.4.7.phar to phpunit.phar), then the script should run.

Sign up to request clarification or add additional context in comments.

Comments

5

If you created phpunit.cmd and it still doesn't work, you should just rename phpunit-7.0.2.phar to phpunit.phar, because, by default, it refers to a name phpunit.phar

1 Comment

Helps in 90% of same situations :D
2

Sigh, if you're installing this on windows you'll get to the part here you have have to enter this command to create the phpunit.cmd

echo @php "%~dp0phpunit.phar" %* > phpunit.cmd

do yourself a favour, copy it in as I was simply entering something incorrectly.

1 Comment

Just wanted to add to this - If you've preserved your phpunit's version number, so the filename itself is phpunit-x.y.z.phar, you need to change the above command to reflect the actual name of the phpunit.phar file, that is: echo @php "%~dp0phpunit-x.y.z.phar" %* > phpunit.cmd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.