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笔试题

一、基础题 1. 写出如下程序的输出结果 复制代码 代码如下: <? $str1 = null; $str2 = false; echo $str1==$str2 ? '相等' :...

PHP __autoload函数(自动载入类文件)的使用方法

这也是OO设计的基本思想之一。在PHP5之前,如果需要使用一个类,只需要直接使用include/require将其包含进来即可。下面是一个实际的例子: 复制代码 代码如下: class...

php curl批处理实现可控并发异步操作示例

本文实例讲述了php curl批处理实现可控并发异步操作。分享给大家供大家参考,具体如下: 通常情况下 PHP 中的 cURL 是阻塞运行的,就是说创建一个 cURL 请求以后必须等它执...

PHP类的使用 实例代码讲解

PHP 只有类别 (class)、方法 (method)、属性、以及单一继承 (extensions) 等。对不习惯使用 C++、Java、Delphi 等面向对象语言来开发程序的用户,...

PHP面向对象程序设计(OOP)之方法重写(override)操作示例

本文实例讲述了PHP面向对象程序设计(OOP)之方法重写(override)操作。分享给大家供大家参考,具体如下: 因为PHP是弱类型的语言, 所以在方法的参数中本身就可以接收不同类型的...