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变量传值赋值和引用赋值变量销毁

详解PHP变量传值赋值和引用赋值变量销毁

本文实例为大家分享了PHP变量传值赋值和引用赋值变量销毁的具体代码,供大家参考,具体内容如下 <?php $a = 100; $b = 200; v...

PHP-CGI远程代码执行漏洞分析与防范

PHP-CGI远程代码执行漏洞分析与防范

CVE-2012-1823出来时据说是“PHP远程代码执行漏洞”,曾经也“轰动一时”,当时的我只是刚踏入安全门的一个小菜,直到前段时间tomato师傅让我看一个案例,我才想起来这个漏洞。...

php结合安卓客户端实现查询交互实例

PHP 服务器端: function getids() { $this->output->set_header('Content-Type: application...

php中数字、字符与对象判断函数用法实例

本文实例讲述了php中数字、字符与对象判断函数用法。分享给大家供大家参考。具体分析如下: 在php判断数字,字符,对象,数组等包括有参见 is_bool()、is_int()、is_in...