安装 phpunit 中的问题 - 尝试在频道 phpunit 上回退到 https 而不是 http
当我尝试在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要
在发出安装命令之前执行以下操作。
除此之外,xampp 通常附带旧的(损坏的)版本的 pear。
请确保您安装了
pear 版本
的当前版本。应该是1.9.4。如果没有,请不要尝试升级 xampp 附带的 pear。虽然可能需要付出很大的努力,但安装干净、新鲜的梨比修复破损的东西要容易得多。
请参阅:Pear 安装
You need to do a
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
正如 @aaronbauman 提到的,您不能再通过 PEAR 安装 phpunit。您不能使用 apt-get 安装它,因为 PHPCoverage 不包含在 PHPUnit 包中。相反,您应该下载 phar 文件:
文档: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:
Documentation: https://phpunit.de/getting-started.html
HTTPS 应该适用于 PHPUnit。您使用的代理可能不支持 HTTPS。
HTTPS is supposed to work for PHPUnit. It may be that you are using a proxy that doesn't support HTTPS.
我使用
pear.phpunit.de
而不是phpunit
解决了这个问题I solve this with using
pear.phpunit.de
instead ofphpunit
pear install pear.phpunit.de/PHPUnit
对我有用pear install pear.phpunit.de/PHPUnit
worked for me