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从零开始打造自己的MVC框架之入口文件实现方法详解

PHP从零开始打造自己的MVC框架之入口文件实现方法详解

本文实例讲述了PHP从零开始打造自己的MVC框架之入口文件实现方法。分享给大家供大家参考,具体如下: 首先来了解一下框架的运行流程: 入口文件 -> 定义常量 -> 引入函...

ThinkPHP跳转页success及error模板实例教程

本文以实例讲解了ThinkPHP跳转页面的success与error方法所对应的视图与控制器的实现方法,通过本实例教程可以帮助读者更好的掌握success方法与error方法的使用。 首...

PHP中ADODB类详解

 虽然 PHP 是建构 Web 系统强有力的工具,但是 PHP 存取数据库的功能,一直未能标准化,每一种数据库,都使...

PHP 杂谈《重构-改善既有代码的设计》之四 简化条件表达式

PHP 杂谈《重构-改善既有代码的设计》之四 简化条件表达式

思维导图 点击下图,查看大图。  介绍    条件逻辑有可能十分复杂,因此本章提供一些重构的手法,专门用来简化它们。   全文简述(你可直接跳...

php调用KyotoTycoon简单实例

本文实例讲述了php调用KyotoTycoon的方法。分享给大家供大家参考。具体如下: Kyoto Tycoon(简称KT)是Tokyo Tyrant 的作者Mikio Hirabaya...