调用php文件的错误

来源:百度知道 编辑:UC知道 时间:2024/05/12 04:20:38
因为我的机器无法运行Apache+php+mqsql,所以我在服务器上做,然后在本机运行服务器文件.我运行的是oil下的index.php文件,出现如下错误:
Warning: require(Server/web/peak/oil_xin/config/top.php) [function.require]: failed to open stream: No such file or directory in D:\web\peak\oil_xin\index.php on line 28

Fatal error: require() [function.require]: Failed opening required 'Server/web/peak/oil_xin/config/top.php' (include_path='.;C:\php5\pear') in D:\web\peak\oil_xin\index.php on line 28

说明: index.php调用的config 下的top.php

D:\web\peak\oil_xin\index.php 文件第 28 行的语句是require(Server/web/peak/oil_xin/config/top.php),计算后的对应文件:\web\peak\oil_xin\Server\web\peak\oil_xin\config\top.php,而这个文件不存在,所以出错。

你应该检查一下top.php究竟在什么目录下,修改index.php的第28行,或者把文件移动到指定位置。

index.php的第28行修改为下面语句即可:
require(config/top.php);

我跟你一样的问题,以前我的 都能够用include函数的,反正现在用不了了,我看了很多关于这方面的文章,总结了一下很有可能就是php.ini的配置里路径不对,你也多去看看吧,解决了也通知我一下哦

是不是应该把requir中的内容用引号引起来呀,比如requir("Server/web/peak/oil_xin/config/top.php");
我也是猜的,不对别骂我!