PHP:如何调整 PHPUnit 以使用不同的 PHP 解释器?

2022-01-14 00:00:00 configuration xampp php phpunit

我的系统有两个 PHP 解释器.一个是与操作系统捆绑在一起的,另一个是我通过 XAMPP 包安装的.我所有的 PHP 扩展都应用于 XAMPP 安装,但 PHPUnit 似乎只运行我的机器附带的 PHP 版本.

My system has two PHP interpreters. One came bundled with the OS and the other I installed via the XAMPP package. All of my PHP extensions are applied to the XAMPP installation but PHPUnit seems to only run the version of PHP that came with my machine.

有人知道我可以配置或重建 PHPUnit 以便它专门使用我的 XAMPP PHP 解释器吗?

Does anybody know of a way I can configure or rebuild PHPUnit so that it uses my XAMPP PHP interpreter exclusively?

推荐答案

找到你安装PHPUnit的文件夹.应该有一个名为phpunit.bat的文件.它应该有一行内容类似于

Find the folder you installed PHPUnit in. There should be a file called phpunit.bat. It should have a line that reads something like

set PHPBIN="C:phpphp.exe"
%PHPBIN% "C:phpphpunit" %*

改为阅读

set PHPBIN="C:xamppphpphp.exe"
%PHPBIN% "C:xamppphpphpunit" %*

或者你的 PHP 可执行文件的路径是什么

Or whatever the path to your PHP executable is

相关文章