【问题标题】:PHP Unit not working on Ubuntu 12.04 LTS with PHP5.6PHP 单元无法在带有 PHP5.6 的 Ubuntu 12.04 LTS 上运行
【发布时间】:2017-07-14 20:57:23
【问题描述】:

任何人都可以帮助我解决我的问题。我想在 php5.6 上运行 phpunit,但遇到了问题

:~$ phpunit
PHP Warning:  require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error:  require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php') in /usr/bin/phpunit on line 38

Pear Packed 已安装

已安装的包,频道 pear.php.net:

包版本状态 Archive_Tar 1.4.0 稳定版 基准 1.2.9 稳定 Console_Getopt 1.4.1 稳定版 PEAR 1.10.1 稳定版 PEAR_Manpages 1.10.0 稳定版 PHPUnit 1.3.2 稳定版 Structures_Graph 1.1.1 稳定版 XML_Util 1.3.0 稳定版

为了安装 PHPUnit,我确实在终端上运行了以下命令

:~$ sudo pear install pear/PHPUnit

因为:~$ sudo pear install phpunit/PHPUnit 不工作。

我确实尝试添加:~$ pear channel-discover pear.phpunit.de,但它显示错误

Error: No version number found in <channel> tag
Discovering channel pear.phpunit.de over http:// failed with message: channel-add: invalid channel.xml file
Trying to discover channel pear.phpunit.de over https:// instead
Error: No version number found in <channel> tag
Discovery of channel "pear.phpunit.de" failed (channel-add: invalid channel.xml file)

谁能告诉我如何解决这个问题?

【问题讨论】:

    标签: php phpunit ubuntu-12.04 pear php-code-coverage


    【解决方案1】:

    PHPUnit cannot be installed via the PEAR Installer anymore.

    查看此“Getting Started”操作指南,了解如何使用 PHAR 或 Composer 安装 PHPUnit。

    【讨论】:

    • 我试过了。它不工作。它显示相同的错误
    【解决方案2】:

    已解决安装问题 对于 PHPUnit 5.7,请使用 https://phar.phpunit.de/phpunit-5.7.phar 而不是 https://phar.phpunit.de/phpunit.phar。如果继续使用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-07
      • 1970-01-01
      • 1970-01-01
      • 2020-08-16
      相关资源
      最近更新 更多