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

yipeiwu_com4年前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针对中英文混合字符串长度判断及截取方法。分享给大家供大家参考,具体如下: /** * * 中英混合字符串长度判断 * @param unknown_ty...

PHP5.3与5.5废弃与过期函数整理汇总

很多PHP程序员都知道,从PHP5.3开始加入了一个新的报错级别DEPRECATED,即将废弃/过期。下面我们来一个个版本梳理一下。 在php5.3被放弃的函数有: call_us...

php冒泡排序与快速排序实例详解

本文实例分析了php冒泡排序与快速排序算法。分享给大家供大家参考,具体如下: $a=array('3','8','1','4','11','7'); print_r($a); $le...

php switch语句多个值匹配同一代码块应用示例

先说说switch()语句的格式 switch(表达式){ case 匹配1: 当匹配1和表达式匹配成功执行的代码; break; case 匹配2: 当匹配2和表达式匹配成功执行的代码...

浅谈PHP无限极分类原理

浅谈PHP无限极分类原理

1.递归:程序调用自身的编程技巧称为递归 2.案例: /** * @param 递归 $[name] */ function deeploop(&$i=1){ echo...