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实现单例模式(singleton)

学习php设计模式 php实现单例模式(singleton)

保证一个类仅有一个实例,并且提供一个访问它的全局访问点。 单例模式有三个特点: 1、一个类只有一个实例 2、它必须自行创建这个实例 3、必须自行向整个系统提供这个实例 一、单例模式结构图...

php函数间的参数传递(值传递/引用传递)

php:函数间的参数传递 1.值传递 复制代码 代码如下: <?php function exam($var1){ $var1++; echo "In Exam:" . $var1...

php单态设计模式(单例模式)实例

单态设计模式也叫单例模式: 1.单态设计模式含义: 单态模式的主要作用是保证在面向对象编程设计中,一个类只能有一个实例对象存在。作为对象的创建模式,单例模式确保某一个类只有一个实例,而且...

PHP7扩展开发教程之Hello World实现方法示例

本文实例讲述了PHP7扩展开发教程之Hello World实现方法。分享给大家供大家参考,具体如下: 一、下载PHP源代码 要开发PHP扩展,需要先下载PHP的源代码,一方面是因为我们的...

PHP+iframe模拟Ajax上传文件功能示例

PHP+iframe模拟Ajax上传文件功能示例

本文实例讲述了PHP+iframe模拟Ajax上传文件功能。分享给大家供大家参考,具体如下: 在xmlhttprequest level 1中,Ajax是不能够上传文件的,因为js不能操...