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.

0
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
  • Helps in 90% of same situations :D Dec 21, 2018 at 14:26
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
  • 2
    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 Jun 2, 2017 at 4:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.