模板酷站

电脑版
提示:原网页已由神马搜索转码, 内容由www.mb5u.com提供.

解决php脚本中include文件报错的方法_PHP教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:PHP实例 PHP实现定时生成HTML网站首页在开始之前还是提一下三个函数吧:ob_start()、ob_end_clean()、ob_get_contents() ob_start():是打开缓冲区的,就是要把您需要生成的静态文件的内容缓存在这里; ob_get_c

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

分享:如何用PHP程序对网页表单进行处理PHP _GET 和 _POST变量是用来获取表单中的信息的,比如用户输入的信息。 PHP表单操作 在我们处理HTML表单和PHP表单时,我们要记住的重要一点是:HTML页面中的任何一个表单元素都可以自

来源:模板无忧/所属分类:PHP教程/更新时间:2009-09-11
最新评论:

暂时还没人评论! 快来抢沙发啊!


匿名评论
相关PHP教程