【问题标题】:failed to open stream: No such file or directory in /usr/bin/phpunit无法打开流:/usr/bin/phpunit 中没有这样的文件或目录
【发布时间】:2012-03-27 12:06:31
【问题描述】:

在尝试使用 Zend Framework 进行单元测试时,我执行了命令

sudo  phpunit --configuration phpunit.xml

得到这个错误

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:/usr/share/pear') in /usr/bin/phpunit on line 38

【问题讨论】:

  • 看起来您的 include_path 中没有某些内容,这通常会引发此类错误。
  • 你安装的是什么版本的PHPUnit? (phpunit --version) PHP_CodeCoverage_Filter 在 3.6.x 中不再被 /usr/bin/phpunit 引用。

标签: zend-framework phpunit ubuntu-11.10


【解决方案1】:

听起来你安装的 phpunit 没有包含所有依赖包,比如PHP_CodeCoverage

也许可以试试:

sudo pear install --alldeps phpunit/PHPUnit

更多详细信息请参见文档的PHPUnit installation 页面。

【讨论】:

    【解决方案2】:

    也许你的梨太老了。

    查看以下提示是否可以解决问题: http://www.giocc.com/installing-phpunit-on-ubuntu-11-04-natty-narwhal.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-27
      • 2013-12-15
      • 2023-04-04
      • 2016-03-28
      • 2015-11-29
      • 1970-01-01
      相关资源
      最近更新 更多