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常用字符串输出方法分析(echo,print,printf及sprintf) 原创

本文讲述了php常用字符串输出方法。分享给大家共大家参考,具体如下: 1. echo用法:可用echo 直接输出,也可以用echo()输出,无返回值 $string="<b&g...

PHP实现的权重算法示例【可用于游戏根据权限来随机物品】

本文实例讲述了PHP实现的权重算法。分享给大家供大家参考,具体如下: 假设有数据: $data = array ( array ( 'id' => 1, 'name' =...

PHP fgetcsv 定义和用法(附windows与linux下兼容问题)

PHP fgetcsv 定义和用法   PHP fgetcsv() 函数从文件指针中读入一行并解析 CSV 字段。   与PHP fgets() 类似,不同的是 PHP fgetcsv(...

PHP实现算式验证码和汉字验证码实例

在PHP网站开发中,验证码可以有效地保护我们的表单不被恶意提交,但是如果不使用算式验证码或者汉字验证码,仅仅使用简单的字母或者数字验证码,这样的验证码方案真的安全吗? 大家知道简单数字或...

php简单随机字符串生成方法示例

本文实例讲述了php简单随机字符串生成方法。分享给大家供大家参考,具体如下: <?php function rand_str($length,$p='all'){ $...