phpunit – 错误的路径

栏目: PHP · 发布时间: 7年前

内容简介:翻译自:https://stackoverflow.com/questions/5022894/phpunit-wrong-path

有人知道我做错了什么吗?

我安装了phpunit,当我在/ opt / local / PEAR目录下时一切都很好,所以如果我去/ opt / local / PEAR目录并运行phpunit,我会得到:

PHPUnit 3.5.11 by Sebastian Bergmann.

Usage: phpunit [switches] UnitTest [UnitTest.php]

phpunit [switches]

blablabla

但如果我在另一条路上,我会得到:

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

我知道我的PATH有问题.我该如何解决?

尝试将/ opt / local / PEAR添加到php.ini文件include_path.

//Before:
include_path='.:/usr/lib/php'
//After:
include_path='.:/usr/lib/php:/opt/local/PEAR'

您可能还需要重新启动Web服务器才能使更改生效.

正如RobertPitt评论的那样,这也可以在运行时完成而无需访问php.ini文件.

<?php
$path = '/opt/local/PEAR';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
?>

翻译自:https://stackoverflow.com/questions/5022894/phpunit-wrong-path


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web Caching

Web Caching

Duane Wessels / O'Reilly Media, Inc. / 2001-6 / 39.95美元

On the World Wide Web, speed and efficiency are vital. Users have little patience for slow web pages, while network administrators want to make the most of their available bandwidth. A properly design......一起来看看 《Web Caching》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具