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实现生成数据字典功能示例

本文实例讲述了PHP实现生成数据字典功能。分享给大家供大家参考,具体如下: 最近时间紧迫,没有时间发博客,趁现在有点时间向大家分享一个知识点。在咱们做开发的时候 ,也许经常会遇到对数据库...

php结合md5实现的加密解密方法

本文实例讲述了php结合md5实现的加密解密方法。分享给大家供大家参考,具体如下: 最近在整理代码发现了一个不错的东西,结合md5的加解密算法。网上关于php结合md5的加密,解密算法比...

php设置允许大文件上传示例代码

用Nginx做为代理服务器, 后端为 apache2. 设置允许上传最大为100M的文件. 1. Nginx配置: http { ...... client_max_body_size...

php中namespace use用法实例分析

本文实例讲述了php中namespace use用法。分享给大家供大家参考,具体如下: 现在说这个感觉有点过时了,但是感觉用namespace的人还是不多,估计还是因为不习惯吧。 cla...

PHP中十六进制颜色与RGB颜色值互转的方法

16进制的颜色值通常表示为#FFFFFF,当前也有缩减为#FFF,前提是两位两位必需相同,例如#FEFEFE这种,就不能进行缩减。而RGB的颜色格式是由3组0~255的数字构成,分别代表...