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实现策略模式(strategy)

学习php设计模式 php实现策略模式(strategy)

一、意图 定义一系列的算法,把它们一个个封装起来,并且使它们可相互替换。策略模式可以使算法可独立于使用它的客户而变化 策略模式变化的是算法 二、策略模式结构图   三、策略模式...

PHP中你应该知道的require()文件包含的正确用法

PHP中你应该知道的require()文件包含的正确用法

以前看一些PHP框架源码的时候,很奇怪在文件包含的时候,会用dirname(__FILE__)来拼凑文件路径,不知道这样做有什么好处,后来终于发现了其中的缘由。 我们来看一个简单的例子:...

PHP获取photoshop写入图片文字信息的方法

本文实例讲述了PHP获取photoshop写入图片文字信息的方法。分享给大家供大家参考。具体分析如下: 有些摄影师喜欢把图片的标题,内容,关键词等用photoshop直接写入图片文件里面...

PHP中4种常用的抓取网络数据方法

本小节的名称为 fsockopen,curl与file_get_contents,具体是探讨这三种方式进行网络数据输入输出的一些汇总。关于 fsockopen 前面已经谈了不少,下面开始...

采用PHP函数memory_get_usage获取PHP内存清耗量的方法

一,函数原型 int memory_get_usage ([ bool $real_usage = false ] ) 二,版本兼容 PHP 4 >= 4.3.2, PHP 5 三...