安装 phpunit 中的问题 - 尝试在频道 phpunit 上回退到 https 而不是 http

发布于 2024-12-23 11:05:36 字数 347 浏览 4 评论 0原文

当我尝试在 xampp 中安装 phpunit 时,出现此错误。

C:\xampp\php>pear install --alldeps phpunit/PHPUnit
Attempting to discover channel "phpunit"...
Attempting fallback to https instead of http on channel "phpunit"...
unknown channel "phpunit" in "phpunit/PHPUnit"
invalid package name/package file "phpunit/PHPUnit"
install failed

I am getting this error while i try to install phpunit in xampp.

C:\xampp\php>pear install --alldeps phpunit/PHPUnit
Attempting to discover channel "phpunit"...
Attempting fallback to https instead of http on channel "phpunit"...
unknown channel "phpunit" in "phpunit/PHPUnit"
invalid package name/package file "phpunit/PHPUnit"
install failed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

じее 2024-12-30 11:05:36

您需要

pear channel-discover pear.phpunit.de

在发出安装命令之前执行以下操作。


除此之外,xampp 通常附带旧的(损坏的)版本的 pear。

请确保您安装了 pear 版本 的当前版本。应该是1.9.4。

如果没有,请不要尝试升级 xampp 附带的 pear。虽然可能需要付出很大的努力,但安装干净、新鲜的梨比修复破损的东西要容易得多。

请参阅:Pear 安装

You need to do a

pear channel-discover pear.phpunit.de

before issuing the install command.


Apart from that note that xampp usually ships with a old (broken) version of pear.

Please make sure you have the current version installed with pear version. It should say 1.9.4.

If not don't try to upgrade the pear that xampp ships. While it is possible with much effort it is a lot easier to install a clean, fresh pear instead of fixing the broken stuff.

See: Pear Installation

后来的我们 2024-12-30 11:05:36

正如 @aaronbauman 提到的,您不能再通过 PEAR 安装 phpunit。您不能使用 apt-get 安装它,因为 PHPCoverage 不包含在 PHPUnit 包中。相反,您应该下载 phar 文件:

wget https://phar.phpunit.de/phpunit.phar

chmod +x phpunit.phar

sudo mv phpunit.phar /usr/local/bin/phpunit

phpunit --version

文档:https://phpunit.de/getting-started.html

You can not install phpunit through PEAR any more, as @aaronbauman mentioned. You can not install it with apt-get, because PHPCoverage is not included in the PHPUnit package. Instead you should download phar file:

wget https://phar.phpunit.de/phpunit.phar

chmod +x phpunit.phar

sudo mv phpunit.phar /usr/local/bin/phpunit

phpunit --version

Documentation: https://phpunit.de/getting-started.html

掩耳倾听 2024-12-30 11:05:36

HTTPS 应该适用于 PHPUnit。您使用的代理可能不支持 HTTPS。

HTTPS is supposed to work for PHPUnit. It may be that you are using a proxy that doesn't support HTTPS.

合久必婚 2024-12-30 11:05:36

我使用 pear.phpunit.de 而不是 phpunit 解决了这个问题

# pear channel-discover pear.phpunit.de
# pear channel-discover pear.symfony.com
# pear install --alldeps symfony2/Yaml
# pear install --alldeps pear.phpunit.de/PHPUnit

I solve this with using pear.phpunit.de instead of phpunit

# pear channel-discover pear.phpunit.de
# pear channel-discover pear.symfony.com
# pear install --alldeps symfony2/Yaml
# pear install --alldeps pear.phpunit.de/PHPUnit
青萝楚歌 2024-12-30 11:05:36

pear install pear.phpunit.de/PHPUnit 对我有用

pear install pear.phpunit.de/PHPUnit worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文