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


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

查看所有标签

猜你喜欢:

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

数据结构与算法

数据结构与算法

2008-7 / 29.00元

《21世纪高等院校计算机教材系列·数据结构与算法(第2版)》详细讲述了线性结构、树结构和图结构中的数据表示及数据处理的方法,对查找和排序两种重要的数据处理进行了详细的探讨。一起来看看 《数据结构与算法》 这本书的介绍吧!

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

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

SHA 加密
SHA 加密

SHA 加密工具