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中获取指定IP的物理地址的代码(正则表达式)

php中获取指定IP的物理地址的代码(正则表达式)

自己搭建IP数据库占资源,而且更新不便,何不使用现成的IP查询呢?下面自己写了个获取IP物理地址的PHP代码(有一定的瑕疵,请高手不吝赐教) 复制代码 代码如下: <!DOCTYP...

php的命名空间与自动加载实现方法

类的自动加载 引子 当我们在php代码中加载类时,我们必须要include或者require 某个类文件。 但遇到类似的情况,例如: require "Class1.php";...

php对象工厂类完整示例

本文实例讲述了php对象工厂类。分享给大家供大家参考,具体如下: <?php /** * 对象工厂 * @author flynetcn */ class Obj...

PHP中使用Imagick读取pdf并生成png缩略图实例

pdf生成png首页缩略图 (服务器需要支持Imagick)  复制代码 代码如下:  /** * PDF2PNG    * @...

php中10个不同等级压缩优化图片操作示例

本文实例分析了php中10个不同等级压缩优化图片操作。分享给大家供大家参考,具体如下: 今天找到一个php写的压缩图片程序,可以分10个等级(0-9)来压缩,0等级时压缩比率不是很大,图...