繁体   English   中英

在Windows 10上使用PHP 7.0.7 / Apache2.4安装PHPUnit 5.4,错误:无法打开文件phpunit.phar

[英]Installing PHPUnit 5.4 with PHP 7.0.7 / Apache2.4 on Windows 10, Error : Could not open file phpunit.phar

我在Windows 10机器上使用Apache 2.4设置了PHP 7.0.7的x64(TS - 线程安全)版本。 PHP运行正常。 我从https://phpunit.de/下载了phpunit.phar(PHPUnit 5.4),其中声明PHP 7支持PHPUnit 5.4。我设置了Windows环境变量,以便可以通过命令行访问PHP。 当我执行以下命令时:

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

它生成phpunit.cmd没有任何问题。

之后我执行:phpunit --version

它给了我错误:无法打开文件phpunit.phar

有没有人遇到类似的问题,或者有什么我可能做错了?

我不得不将phpunit-5.4.4.phar的文件名更改为phpunit.phar。 在命令中它是:echo @php“%~dp0phpunit.phar”%*> phpunit.cmd所以将文件名更改为phpunit.phar修复了问题并且PHPUnit运行正常。

干杯:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM