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屏蔽过滤指定关键字的方法

本文实例讲述了PHP屏蔽过滤指定关键字的方法。分享给大家供大家参考。具体分析如下: 实现思路: 一、把关键字专门写在一个文本文件里,每行一个,数量不限,有多少写多少。 二、PHP读取关键...

微盾PHP脚本加密专家php解密算法

复制代码 代码如下: <?php /*********************************** *威盾PHP加密专家解密算法 By:Neeao *http://Neea...

PHP中strnatcmp()函数“自然排序算法”进行字符串比较用法分析(对比strcmp函数)

本文实例讲述了PHP中strnatcmp()函数“自然排序算法”进行字符串比较用法。分享给大家供大家参考,具体如下: PHP中strnatcmp()函数使用"自然"算法来比较两个字符串(...

PHP迭代器和生成器用法实例分析

本文实例讲述了PHP迭代器和生成器用法。分享给大家供大家参考,具体如下: 迭代器 迭代器实际是一个实现了Iterator的类,可以用foreach进行遍历。 例如: <?...

php实现XML和数组的相互转化功能示例

本文实例讲述了php实现XML和数组的相互转化功能。分享给大家供大家参考,具体如下: 数组转化为xml: function arrtoxml($arr,$dom=0,$item=0)...