PHPUnit命令行工具不工作

时间:2022-10-22 14:55:58

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?

有没有其他人有同样的问题或知道解决方案?

2 个解决方案

#1


32  

Make sure your PEAR is up do date:

确保您的PEAR已完成日期:

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

#2


1  

For Debian or Ubuntu, add this to your PHP ini file:

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

suhosin.executor.include.whitelist="phar"

#1


32  

Make sure your PEAR is up do date:

确保您的PEAR已完成日期:

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

#2


1  

For Debian or Ubuntu, add this to your PHP ini file:

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

suhosin.executor.include.whitelist="phar"