PHP安装警告:[function.require-once]:未能打开流
问题描述:
我尝试在本地安装groupon克隆的脚本时出现问题。 即时通讯使用XAMPP在Windows7PHP安装警告:[function.require-once]:未能打开流
Apache/2.2.17 (Win32) mod_ssl/2.2.17
OpenSSL/0.9.8o
PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625
运行这是我在尝试的index.php运行:
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config\Container.php on line 111
Warning: require_once(DOCUMENT_ROOT/system/plugins/common.php) [function.require-once]: failed to open stream: No such file or directory in C:\Users\xxxx\Documents\Eclipse\xxxx\system\includes\library.inc.php on line 17
Fatal error: require_once() [function.require]: Failed opening required 'DOCUMENT_ROOT/system/plugins/common.php' (include_path='.;C:\xampp\php\PEAR') in C:\Users\xxxx\Documents\Eclipse\xxxx\system\includes\library.inc.php on line 17
php文件这样开始:
session_start();
require_once ('config.php'); // this is the one that defines DOCUMENT_ROOT
require_once ('functions.php');
require_once ('functions_theme.php');
require_once ('fns.php');
这里是线17:
require_once (DOCUMENT_ROOT.'/system/plugins/common.php');
DOCUMENT_ROOT这样定义在config.php文件之前加载:
define("DOCUMENT_ROOT",$_SERVER['DOCUMENT_ROOT']);
希望有人可以提供帮助。
并且YES,该文件在该目录中(已经检查过:P)。
答
DOCUMENT_ROOT
常量没有被正确解析(我认为包含哪个文件的文件没有被正确包含)并且PHP正在回退到使用字符串DOCUMENT_ROOT
。
明显没有包含其他PHP文件,或者该行未被运行。 – Kenaniah 2011-12-16 00:19:25
在你试图包含你的文件之前,你确定包含`define`语句的文件真的被加载吗? 'Warning:require_once(DOCUMENT_ROOT/system/plugins/common.php)`部分似乎告诉'DOCUMENT_ROOT`尚未定义。 – Cyclonecode 2011-12-16 00:22:58