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 MemCached高级缓存配置图文教程

PHP MemCached高级缓存配置图文教程

1.Memcache相关介绍 memcache是一个高性能的分布式的内存对象缓存系统,它能够用来存储各种格式的数据,包括图像、视频、文件以及数据库检索的结果等。 使用Memcache的网...

PHP获取文件绝对路径的代码(上一级目录)

PHP获取文件绝对路径 复制代码 代码如下: <?php echo __FILE__ ; // 取得当前文件的绝对地址,结果:D:\www\test.php echo dirnam...

PHP5+UTF8多文件上传类

还有些功能没有加上去,如自动更名,图片处理等.可根据需要自己添加. USE: $up = new upfile(ROOT_PATH.'data/'.date("Ym",time()),a...

自动生成文章摘要的代码[PHP 版本]

实现内容:截断一段含有HTML代码的文本,但是不会出现围堵标记没有封闭的问题。 说明:这是PHP版的,用于在服务器端使用,如果你需要一个客户端版的,请阅读下一篇  我们在写BL...

PHP基于正则批量替换Img中src内容实现获取缩略图的功能示例

本文实例讲述了PHP基于正则批量替换Img中src内容实现获取缩略图的功能。分享给大家供大家参考,具体如下: 这里PHP用正则批量替换Img中src内容,实现获取图片路径缩略图的功能 网...