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 return语句另类用法不止是在函数中

分享下PHP return语句的另一个作用,在bbPress的代码中看到的一个奇葩使用方法。 一直以为,return只能出现在函数中,直到看了bbPress的代码: <?...

用PHP写的基于Memcache的Queue实现代码

php类代码: 复制代码 代码如下: <?php class MQ{ public static $client; private static $m_real; private...

PHP创建桌面快捷方式的实例代码

复制代码 代码如下:$shortCut = "[InternetShortcut]URL=//www.jb51.netIDList=[{000214A0-0000-0000-C000-0...

PHP程序漏洞产生的原因分析与防范方法说明

滥用include 1.漏洞原因: Include是编写PHP网站中最常用的函数,并且支持相对路径。有很多PHP脚本直接把某输入变量作为Include的参数,造成任意引用脚本、绝对路...

PHP实现的MD5结合RSA签名算法实例

本文实例讲述了PHP实现的MD5结合RSA签名算法。分享给大家供大家参考,具体如下: <?php class Md5RSA{ /** * 利用约定数据和私钥生...