当前位置: 首页 > 图文教程 > 网络编程 > PHP > 网页中PHP脚本中include文件报错解决方法

PHP
phpMyAdmin 3.1.1MySQL数据库管理利器
在Windows下面从源代码编译PHP的步骤
编程大师论道:PHP的魅力和不足何在
Flashlm:增加PHP的Session存储和处理能力
Web 2.0 时代PHP将受更多人的青睐
PHP实现通过Web执行C/C
PHP服务器变量设置的方法介绍
用PHP编程读取汉字点阵数据
初学者必读 PHP常用开发工具分析
在PHP中操作MySQL要注意哪些问题
PHP采集程序中常用的函数
例举PHP语言中的精华与技巧
PHP性能优化的技巧
PHP代码的优与劣
PHP下载远程文件类(支持断点续传)
PHP的正则处理函数总结分析
PHP 反射机制实现动态代理的代码
PHP中函数内引用全局变量的方法
使用PHP重新实现PHP脚本引擎内置函数
表单FORM与GET方法的区别

网页中PHP脚本中include文件报错解决方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 63 ::
收藏到网摘: n/a

经常当php页面中利用include, require, require_once包含了一些其他位置的页面时,会出现错误,比如没有发现次页面,或者权限不允许等,可以根据以下方法来排除

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