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动态生成版权所有信息的方法。分享给大家供大家参考。具体实现方法如下: function copyright($start, $owner) { $date = d...

PHP日期处理函数 整型日期格式

当我过去用ASP时解决这个问题相当简单,ASP有相应的函数DateDiff可以给出两个日期间间隔多少月、多少天和多少秒。当我搜寻完PHP手册后我发现PHP并没有类似的函数。 本文包含以下...

php中随机显示图片的函数代码

例如博客的展示窗 复制代码 代码如下: <?php /********************************************** * Filename : img...

php字符串函数学习之strstr()

复制代码 代码如下: <?php /* 定义和用法 strstr() 函数搜索一个字符串在另一个字符串中的第一次出现。 该函数返回字符串的其余部分(从匹配点)。如果未找到所...

PHP中PDO的错误处理

PHP中PDO的错误处理

面向对象的方式 先看看如果连接错误等的处理,PHP中PDO的错误处理,使用面向对象的方式来处理: 复制代码 代码如下: <?php try {  $db = new PDO('my...