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去掉字符串的最后一个字符附substr()的用法

php去掉字符串的最后一个字符附substr()的用法

今天项目中用到,去掉字符串中的最后一个字符 原字符串1,2,3,4,5,6, 去掉最后一个字符",",最终结果为1,2,3,4,5,6 代码如下: 复制代码 代码如下: $str = "...

php 编写安全的代码时容易犯的错误小结

1.不转意html entities 一个基本的常识:所有不可信任的输入(特别是用户从form中提交的数据) ,输出之前都要转意。 echo $_GET['usename'] ; 这个例...

PHP截取指定图片大小的方法

本文实例讲述了PHP截取指定图片大小的方法。分享给大家供大家参考。具体分析如下: imagecopyresampled($newim, $im, 0, 0, 7, 174, 120, 4...

PHP在innodb引擎下快速代建全文搜索功能简明教程【基于xunsearch】

PHP在innodb引擎下快速代建全文搜索功能简明教程【基于xunsearch】

本文实例讲述了PHP在innodb引擎下快速代建全文搜索功能的方法。分享给大家供大家参考,具体如下: 需要准备的设备:Liunx(Centos)操作系统(只支持Linux),PHP环境。...

PHP静态方法和静态属性及常量属性的区别与介绍

PHP中若使用static关键字来修饰属性、方法,称这些属性、方法为静态属性、静态方法。static关键字声明一个属性或方法是和类相关的,而不是和类的某个特定的实例相关,因此,这类属性或...