Kenny 2007-8-9 14:17
php脚本中include文件报错解决方法
<p>作者:青牛 <span class="postDate"></span> <div class="artcontent"><div id="article_main" _element_extended="true">经常当php页面中利用include, require, require_once包含了一些其他位置的页面时,会出现错误,比如没有发现次页面,或者权限不允许等,可以根据以下<a href="http://www.phpchina.com/javascript:;" onClick="javascript:tagshow(event, '%B7%BD%B7%A8');" target="_self"><u><strong>方法</strong></u></a>来排除<br><p> 1. 出现“未找到文件“类似的错误时候,检查include文件的位置是否正确,下面引用php手册页面的原话:</p><blockquote>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 <var>libraries</var>, current working directory is <var>/www/</var>, you included <var>include/a.php</var> and there is <var>include "b.php"</var> in that file, <var>b.php</var> is first looked in <var>/www/libraries/</var> and then in <var>/www/include/</var>. If filename begins with <var>./</var> or <var>../</var>, it is looked only in include_path relative to the current working directory.</blockquote> 2. 当出现permission deny 类似错误的时候,按以下方法排除<br> a) 检测被包含的文件读权限是否打开<br> b) 检测被包含的文件路径上的每个目录的x权限是否打开,该权限决定了目录能否被浏览。<br><br>来源:http://milton.bloghome.cn/posts/99532.html<br>