PHP脚本中include文件出错解决方法

yipeiwu_com6年前PHP代码库
1. 出现“未找到文件“类似的错误时候,检查include文件的位置是否正确,下面引用php手册页面的原话:
Files for including are first looked in include_path relative to the current working directory and then in the directory of the current script. E.g. if your include_path is libraries, current working directory is /www/, you included include/a.php and there is include "b.php" in that file, b.php is first looked in /www/libraries/ and then in /www/include/. If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory.
2. 当出现permission deny 类似错误的时候,按以下方法排除
a) 检测被包含的文件读权限是否打开
b) 检测被包含的文件路径上的每个目录的x权限是否打开,该权限决定了目录能否被浏览。

相关文章

php class类的用法详细总结

一:结构和调用(实例化): class className{} ,调用:$obj = new className();当类有构造函数时,还应传入参数。如$obj = new classN...

领悟php接口中interface存在的意义

可能大家都懂这些,作为不懂的我猜测了一下这个interface的意义,他就是为了后面调用的时候再调用的方法中调用实现类中interface中存在的内容,好绕口啊,写个例子留作以后看吧pa...

php通过文件头判断格式的方法

本文实例讲述了php通过文件头判断格式的方法。分享给大家供大家参考,具体如下: function judgeFile($file,$form){ if(!empty($file) &...

PHP基于方差和标准差计算学生成绩的稳定性示例

PHP基于方差和标准差计算学生成绩的稳定性示例

本文实例讲述了PHP基于方差和标准差计算学生成绩的稳定性。分享给大家供大家参考,具体如下: 项目中的学生端有处个人成长档案模块,要求依据学生近期十次考试成绩通过波动采集分析学生的成绩稳定...

延长phpmyadmin登录时间的方法

这里我们可以修改它的登录模式为http。这样,只要浏览器不关闭就可以继续使用。 以ubuntu环境,通过apt-get方式安装的phpmyadmin为例。 文档位置在 /etc/phpm...