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权限是否打开,该权限决定了目录能否被浏览。

相关文章

wamp安装后自定义配置的方法

WampServer是目前应用非常广泛的PHP集成开发环境,本文就来讲述Wamp安装后自定义配置的方法。供大家参考借鉴。具体如下: wamp2.5安装完毕后,自己手动重新设置了apach...

PHP反射机制原理与用法详解

本文实例讲述了PHP反射机制原理与用法。分享给大家供大家参考,具体如下: 反射 面向对象编程中对象被赋予了自省的能力,而这个自省的过程就是反射。 反射,直观理解就是根据到达地找到出发地和...

php继承中方法重载(覆盖)的应用场合

本文实例分析了php继承中方法重载(覆盖)的应用场合。分享给大家供大家参考。具体分析如下: 方法重载(override)/覆盖——在什么情况下使用:当父类知道所有的子类都需要用到一个方法...

jQuery 源码分析笔记

jQuery的宗旨是Write Less, Do More。它对JavaScript的开发风格侵入性不如YUI那么强,当然也不如Dojo和YUI如此庞大。它极大的简化了JavaScrip...

PHP连接MongoDB示例代码

复制代码 代码如下: <?php //这里采用默认连接本机的27017端口,当然你也可以连接远程主机如192.168.0.4:27017,如果端口是27017,端口可以省略 $m...