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判断字符串长度,使用isset()在速度上比strlen()更快,执行效率更高。即:复制代码 代码如下:$str = ‘aaaaaa';if(strlen($s...

php array_intersect()函数使用代码

array array_intersect ( array array1, array array2 [, array ...]) array_intersect() 函数返回两个或多个...

php抽奖概率算法(刮刮卡,大转盘)

本文实例为大家分享了php中奖概率算法,可用于刮刮卡,大转盘等抽奖算法,用法很简单,代码里有详细注释说明,供大家参考,具体内容如下 <?php /* * 经典的概率算...

WordPress中获取页面链接和标题的相关PHP函数用法解析

get_permalink()(获取文章或页面链接) get_permalink() 用来根据固定连接返回文章或者页面的链接。在获取链接时 get_permalink() 函数需要知道要...

PHP Token(令牌)设计

PHP Token(令牌)设计

如何达到目的: 怎样避免重复提交? 在SESSION里要存一个数组,这个数组存放以经成功提交的token.在后台处理时,先判断这个token是否在这个数组里,如果存在,说明是重复提交.&...