【问题标题】:Issues while installing pear.phpunit.de/PHPUnit安装 pear.phpunit.de/PHPUnit 时的问题
【发布时间】:2015-04-11 21:58:48
【问题描述】:

我试图告诉pear 使用这个命令在哪里可以找到 PHPUnit:

sudo pear channel-discover pear.phpunit.de

输出是:

Discovering channel pear.phpunit.de over http:// failed with message: channel-add: Cannot open "http://pear.phpunit.de/channel.xml" (File http://pear.phpunit.de:80/channel.xml not valid (received: HTTP/1.1 410 Gone
))
Trying to discover channel pear.phpunit.de over https:// instead
Discovery of channel "pear.phpunit.de" failed (channel-add: Cannot open "https://pear.phpunit.de/channel.xml" (File https://pear.phpunit.de:443/channel.xml not valid (received: HTTP/1.1 410 Gone
)))

我尝试了以下命令:

sudo pear channel-update pear.php.net
sudo pear upgrade-all

然后我再次运行channel-discover 命令。我遇到了与上图相同的错误。
我什至尝试了这些命令:

sudo pear config-set auto_discover 1

输出:

config-set succeeded

然后我尝试了这个命令:

sudo pear install pear.phpunit.de/PHPUnit

输出:

Attempting to discover channel "pear.phpunit.de"...
Attempting fallback to https instead of http on channel "pear.phpunit.de"...
unknown channel "pear.phpunit.de" in "pear.phpunit.de/PHPUnit"
invalid package name/package file "pear.phpunit.de/PHPUnit"
install failed  

所以我访问了这个链接:https://pear.phpunit.de/channel.xml,它显示了410 gone 错误。有没有其他替代方法可以做到这一点?

【问题讨论】:

    标签: php pear


    【解决方案1】:
    【解决方案2】:

    现在大多数人只是作曲家。但是由于您似乎在 Ubuntu 上,您总是可以这样做:

    sudo apt-get install phpunit
    

    【讨论】:

      【解决方案3】:

      下载对我有用的 phar 存档:

      https://github.com/Mayflower/PHP_CodeBrowser

      wget https://github.com/mayflower/PHP_CodeBrowser/releases/download/1.1.1/phpcb-1.1.1.phar
      mv phpcb-1.1.1.phar /usr/local/bin/phpcb
      chmod a+x /usr/local/bin/phpcb
      
      phpcb --version
      PHP_CodeBrowser version 1.1.1
      

      【讨论】:

        【解决方案4】:

        对于那些使用 RHEL 发行版 (CentOS/Fedora/ 等) 并且尚未使用 composer 的用户,您可以使用 YUM 安装 phpunit:

        yum install phpunit
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-10-12
          • 2021-06-05
          • 2017-06-22
          • 2018-10-09
          • 1970-01-01
          • 2022-01-06
          相关资源
          最近更新 更多