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 遍历显示文件夹下所有目录、所有文件的函数,没有分页的代码

<pre> <?php /********************** 一个简单的目录递归函数 第一种实现办法:用dir返回对象 *******************...

小文件php+SQLite存储方案

我们草根站长购买的虚拟主机往往都有文件数量限制,大量小文件占用大量资源,落伍精华区也有兄弟推荐豆瓣的解决方法,但是要有主机权限。只能另装思路,采用php+SQLite解决问题,经过我测试...

简单的方法让你的后台登录更加安全(php中加session验证)

本文将以Joomla!后台链接为例,讲解如何“修改”我们的后台链接,使其更加安全。 原理:通过特定文件为后台入口注册session,否则失败退出。即直接使用原后台地址将无法登录后台。这样...

PHP读取网页文件内容的实现代码(fopen,curl等)

1.fopen实现代码:复制代码 代码如下: <?php $handle = fopen ("http://www.example.com/", "rb"); $contents...

PHP基于redis计数器类定义与用法示例

本文实例讲述了PHP基于redis计数器类定义与用法。分享给大家供大家参考,具体如下: Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-V...