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应用JSON技巧讲解

php json_decode返回数据js的处理 php json_decode后,返回到前台的数据如:encode_str =》{"green":10,"size":5,"strock...

3种方法轻松处理php开发中emoji表情的问题

背景 做微信开发的时候就会发现,存储微信昵称必不可少。 可这万恶的微信支持emoji表情做昵称,这就有点蛋疼了 一般Mysql表设计时,都是用UTF8字符集的。把带有emoji的昵称字段...

php中多维数组按指定value排序的实现代码

呵呵,业务需要按多维数组中某个元素进行排序,在PHP中也是非常容易实现的,一个函数调用一个回调函数就搞定了。贴出代码: 复制代码 代码如下: $arr = array( &nb...

php serialize()与unserialize() 不完全研究

serialize()和unserialize()在php手册上的解释是: serialize — Generates a storable representation of a va...

PHP图片处理之图片背景、画布操作

像验证码或根据动态数据生成统计图标,以及前面介绍的一些GD库操作等都属于动态绘制图像。而在web开发中,也会经常去处理服务器中已存在的图片。例如,根据一些需求对图片进行缩放、加水印、裁剪...