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

PHP
PHP函数:php中rename()函数的妙用
PHP实例:PHP验证码
PHP实例:PHP无限极分类
PHP实例:PHP操作文件类
PHP实例 PHP实现定时生成HTML网站首页
php脚本中include文件报错解决方法
在PHP中显示格式化的用户输入
PHP教程:在PHP中将图片存放ORACLE中
PHP5中的this,self和parent关键字详解
PHP实例:PHP的拼写检查函数库
PHP教程实例:用PHP打造动态聊天室系统
PHP基础:PHP4和PHP5的配置异同比较
使用PHP4.2.0及以后版本的注意事项
一个非常全面获取图象信息的PHP函数
比较测试PHP+MYSQL分页机制两种方案
PHP中用正则表达式验证中文的问题
php程序如何生成验证码图片
用php或js获取图片大小高宽尺寸
phpMyAdmin2.6以上版本数据乱码问题
巧学巧用:如何使用PHP中的字符串函数

PHP 中的 php脚本中include文件报错解决方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 44 ::
收藏到网摘: 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权限是否打开,该权限决定了目录能否被浏览。