PHP脚本中include文件出错解决方法

yipeiwu_com5年前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+jQuery ajax实现的实时刷新显示数据功能示例

本文实例讲述了php+jQuery ajax实现的实时刷新显示数据功能。分享给大家供大家参考,具体如下: 创建数据表:demo -- -- 表的结构 `demo` -- CREATE...

探讨file_get_contents与curl效率及稳定性的分析

做过好多抓取别家网站内容的产品,习惯了使用方便快捷的file_get_contents函数,但是总是会遇到获取失败的问题,尽管按照手册中的例子设置了超时,可多数时候不会奏效:复制代码 代...

基于PHP导出Excel的小经验 完美解决乱码问题

我在PHP项目里要求把数据导出为Excel,并且数据中包含中文.网上大概了解一下可是使用PHPExcel,可是相对我的需求,这个框架太复杂了.于是还是想找找简单做法.网上发现其实最简单可...

php第一次无法获取cookie问题处理

php第一次无法获取cookie问题处理

首先编写以下简单的代码: 复制代码 代码如下: <?php     setcookie('a','value');   ...

PHP htmlspecialchars_decode()函数用法讲解

PHP htmlspecialchars_decode()函数用法讲解

PHP htmlspecialchars_decode() 函数 实例 把预定义的 HTML 实体 "<"(小于)和 ">"(大于)转换为字符: <?php...