简体   繁体   English

PHPUnit命令行工具不起作用

[英]PHPUnit Command Line Tool Not working

I run XAMPP on windows. 我在Windows上运行XAMPP。

I've recently downloaded PHPUnit from the PEAR CLI tool. 我最近从PEAR CLI工具下载了PHPUnit。

Everything looks fine, (eclipse correctly suggests code completion so it means that it was correctly added to the include_path), but whenever I try and get it to work via console by typing phpunit (it's in the environmental PATH variable), it hangs on for a seconds or two and then closes( as if it was terminated). 一切看起来都很好,(eclipse正确地表明了代码完成,因此,它已经正确地添加到了include_path中), 但是每当我尝试通过键入phpunit (在环境PATH变量中)通过控制台使其正常工作时,它都会挂起一两秒钟,然后关闭(好像已终止)。

I've tried phpunit --help also, and no success. 我试过phpunit --help也没有成功。

Also tried phpunit --verbose . 还尝试了phpunit --verbose

Has anyone else had that same problem or knows the solution? 还有其他人有同样的问题或知道解决方案吗?

Make sure your PEAR is up do date: 确保您的梨是最新的:

pear upgrade-all

Do the above until it says nothing to "upgrade-all" then reinstall PHPUnit 进行上述操作,直到没有任何提示“全部升级”,然后重新安装PHPUnit

pear install --alldeps --force phpunit/PHPUnit

If this doesnt fix the error, make sure you have all error reporting enabled in your php.ini and check your error logs. 如果这样不能解决错误,请确保在php.ini中启用了所有错误报告,并检查错误日志。

If this doesn't work, consider using PHPUnit via Composer or Phar instead of PEAR 如果这不起作用,请考虑通过Composer或Phar而不是PEAR使用PHPUnit

对于Debian或Ubuntu,请将其添加到您的PHP ini文件中:

suhosin.executor.include.whitelist="phar"

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

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