Home  >  Article  >  Backend Development  >  pear类调用有关问题

pear类调用有关问题

WBOY
WBOYOriginal
2016-06-13 12:50:12805browse

pear类调用问题
用pear安装的类,默认安装路径,调用的时候发现每个类中require_once('xx'),'xx'并不存在于指定的目录中,即路径不一致,这样调用这个类的时候就会报错,为什么会这样?难道要去安装的类的源码中一个个修改调用类的路径?还是其他的原因?


------解决方案--------------------
当没有在 php.ini 中设置 include_path 时,pear 安装目录是包含在 include_path 的
如果你指定了 include_path 并且要使用 pear,那么应将 pear 安装目录附加在 include_path 中

------解决方案--------------------
那你就调用全路径,比如require("d:\x\xx\1.php");
或者先看看echo dirname(__file__)的结果、
或者用get_include_path确认下目前的包含路径有哪些
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn