Warning:require_once(data/function.php) [function.require-once]:failed to open stream:No such file or directory in D:\www\6471\data\source_index.php on line 2Fatal error:require_once() [function.require]:Failed opening required 'data/function.php' (i

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/10 11:20:49

Warning:require_once(data/function.php) [function.require-once]:failed to open stream:No such file or directory in D:\www\6471\data\source_index.php on line 2Fatal error:require_once() [function.require]:Failed opening required 'data/function.php' (i
Warning:require_once(data/function.php) [function.require-once]:failed to open stream:No such file or directory in D:\www\6471\data\source_index.php on line 2
Fatal error:require_once() [function.require]:Failed opening required 'data/function.php' (include_path='.;C:\php5\pear') in D:\www\6471\data\source_index.php on line 2
怎么处理啊,我是新手不太懂,麻烦讲仔细些,

Warning:require_once(data/function.php) [function.require-once]:failed to open stream:No such file or directory in D:\www\6471\data\source_index.php on line 2Fatal error:require_once() [function.require]:Failed opening required 'data/function.php' (i
通过报错信息我们能够看到('failed to open stream','Failed opening required'),这是被包含的文件无法打开.造成这种错误原因有两个.
1、在source_index.php这个文件同级目录下面没有function.php这个文件.
2、或者是require_once(data/function.php);这条语句写错了,造成无法定位到正确的目录.我在下面再给你介绍一下目录定位的一些知识.
2.1、require_once("data/function.php");
意思是:调用source_index.php所处目录下的data目录下面的function.php文件.
2.2、require_once("/data/function.php");
意思是:调用source_index.php所在目录根目录下面的data目录下面的function.php文件.
2.3、require_once("../data/function.php");
意思是:调用source_index.php上一级目录下面的data目录下面的function.php文件.
2.4、require_once("./data/function.php");
意思是:调用source_index.php当前目录下的data目录下面的function.php文件,与require_once("data/function.php");该条语句的作用是一样的.
希望上面的知识能帮你解决这个问题.