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实现留言板功能

php实现留言板功能

这个小小的留言板功能适合班级内或者公司内部之间的讨论,对话和留言,非常的方便,更重要的是无需网络,对于公司管理层来说是非常乐于常见的, 下面是这个留言板的写法: 1 首先是登录页面:...

php使用ereg验证文件上传的方法

本文实例讲述了php使用ereg验证文件上传的方法。分享给大家供大家参考。具体分析如下: ereg格式如下: 复制代码 代码如下:ereg(正规表达式,字符串,[匹配部分数组名]); 这...

火车头采集器3.0采集图文教程

火车头采集器3.0采集图文教程

以采集示例详解部分功能今天要给大家做示例的网站是163的 娱乐频道 这个应该是个比较通用和实用的规则,下面开始。如果您是火车采集器的老手,那么您可以参考下,因为我要讲解的会有违传统的思维...

Windows2003下php5.4安装配置教程(Apache2.4)

Windows2003下php5.4安装配置教程(Apache2.4)

直接配置php一直使用如同《【php】本地开发环境的部署与helloworld》的一键傻瓜包,被批为极度不专业,关键是这些一键傻瓜包LAMP的版本不好控制,端口什么的也不好调。曾经在Li...

PHP rawurlencode与urlencode函数的深入分析

问题:2个函数都是针对字符串转义使其适合做文件名。该用哪个?哪个更标准? 结论:rawurlencode遵守是94年国际标准备忘录RFC 1738,urlencode实现的是传统做法,和...