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单件模式结合命令链模式使用说明

可能对于部分人来说,文章内容过于浅显,这是送给初学者的教程,因为时间比较紧(要陪老婆逛街,呵呵),其中出现了设计不规范的,代码书写不规范的,bug等等还望各路大侠指出来,方便大家共同进步...

php $_SERVER["REQUEST_URI"]获取值的通用解决方法

复制代码 代码如下: <?php // 说明:获取 _SERVER['REQUEST_URI'] 值的通用解决方案 function request_uri() { if (iss...

php字符串截取函数mb_substr用法实例分析

本文实例讲述了php字符串截取函数mb_substr用法。分享给大家供大家参考,具体如下: string mb_substr ( string $str , int $start [,...

php 记录进行累加并显示总时长为秒的结果

现在有一个mysql数据库的test表里有一个duration字段,里面有三条记录: 00:22:32 13:42:21 134:42:21 表示的是时长,但是,保存类型是文本。 现在要...

php去除二维数组的重复项方法

php中去一维数组的重复项可以通过php内置函数array_unique(),但是php的array_unique函数对多维数组并不适用,怎么才能去除二维数组中的重复项呢? 以下...