安装 PEAR for PHPUnit 时的系统或本地

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

我正在使用 XAMPP 1.8.1.我需要用 PHPUnit 编写代码.当我尝试使用命令提示符安装 PEAR 时,我收到以下消息:

I am using XAMPP 1.8.1. I need to write code with PHPUnit. When I try to install PEAR using command prompt, I get the message below:

您是安装系统范围的 PEAR 还是本地副本?

Are you installing a system-wide PEAR or a local copy?

有人可以建议我应该使用哪个选项吗?提前致谢.

Could some one suggest which option I should use? Thanks in advance.

推荐答案

PEAR 通常安装在系统范围内.这样做的好处是可以在不同的项目之间重复使用各种包.

PEAR is usually installed system-wide. The benefit of this is that the various packages can be reused between different projects.

您可能安装 PEAR 的本地副本 的一个原因是您正在安装的服务器的管理员可能不愿意安装额外的软件包或升级现有的软件包.

One reason why you might install a local copy of PEAR is that the administrator[s] of the server you are installing on might be reluctant to install additional packages or upgrade existing ones.

通过执行 PEAR 的本地安装,您可以选择 PEAR 安装程序放置您安装的包/PEAR 代码的位置.

By performing a local install of PEAR you can choose the location of where the PEAR installer places the packages/PEAR code that you install.

因此,安装 PEAR 的本地(甚至多个)副本的另一个原因是为您可能正在处理的每个项目单独安装,尽管在这种情况下使用 Composer 更为常见.

So, another reason for installing local, even multiple, copies of PEAR is to have separate installs for each project you might be working on, though using Composer in this scenario is much more common place.

当然,如果您确实安装了 PEAR 的本地副本,那么您将需要相应地调整您的包含路径.

Naturally if you do install a local copy of PEAR then you will need to adjust your include-path accordingly.

相关文章