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 常用算法和时间复杂度

按数量级递增排列,常见的时间复杂度有:常数阶O(1),对数阶O(log2n),线性阶O(n),线性对数阶O(nlog2n),平方阶O(n2),立方阶O(n3)复制代码 代码如下://二分...

php获取表单中多个同名input元素的值

有时前台页面要允许动态增加/删除某项属性的多个值,比如向书架中添加书本,要可以动态增加或者删除书本。 前台页面的表单中会有多个input元素,如下: 复制代码 代码如下: <for...

深入php var_dump()函数的详解

php var_dump 函数作用是判断一个变量的类型与长度,并输出变量的数值,如果变量有值输的是变量的值并回返数据类型.来看看var_dump 语法:复制代码 代码如下:var_dum...

PHP使用PDO抽象层获取查询结果的方法示例

本文实例讲述了PHP使用PDO抽象层获取查询结果的方法。分享给大家供大家参考,具体如下: PHP使用PDO抽象层获取查询结果,主要有三种方式: (1)PDO::query()查询。 看下...

PHP token验证生成原理实例分析

本文实例讲述了PHP token验证生成原理。分享给大家供大家参考,具体如下: <?php /** * @Author: Ding Jianlong * @Date...