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 zip压缩包操作类完整实例

本文实例讲述了PHP zip压缩包操作类。分享给大家供大家参考,具体如下: <?php /** * Zip 文件包工具 * * @author wengxianh...

Windows下利用Gvim写PHP产生中文乱码问题解决方法

首先:找出乱码产生的原因。 一直以为是浏览器的原因,结果我在chrome,firefox,IE9里面都出现了乱码,所以浏览器的因素可以排除。为了验证我猜测是Gvim的原因, 我用记事本(...

PHP-redis中文文档介绍

phpredis是php的一个扩展,效率是相当高有链表排序功能,对创建内存级的模块业务关系 很有用;以下是redis官方提供的命令使用技巧: 下载地址如下: https://...

PHP is_subclass_of函数的一个BUG和解决方法

is_subclass_of的作用: 复制代码 代码如下:bool is_subclass_of ( object object, string class_name )如果对象 obj...

PHP设计模式之委托模式定义与用法简单示例

本文实例讲述了PHP设计模式之委托模式定义与用法。分享给大家供大家参考,具体如下: 委托模式: 通过分配或委托至其他对象,委托设计模式能够去除核心对象中的判决和复杂的功能性。 cla...