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

相关文章

php中使用base HTTP验证的方法

本文实例讲述了php中使用base HTTP验证的方法。分享给大家供大家参考。具体如下: function http_auth($un, $pw, $realm = "Secured...

php可应用于面包屑导航的迭代寻找家谱树实现方法

本文实例讲述了php可应用于面包屑导航的迭代寻找家谱树实现方法。分享给大家供大家参考。具体实现方法如下: <?php echo "<pre>"; $area...

php通过隐藏表单控件获取到前两个页面的url

php通过隐藏表单控件获取到前两个页面的url

自己在学习过程中也遇到了类似的问题: 比如,后台是想做成这样子的: 但是实际则是这样的: 解决方法: 通过隐藏表单控件 <input type="hidden" name...

php自动识别文件编码并转换为UTF-8的方法

PHP转换文件编码是一个比较简单的事情,但是在开发中传递中文参数的时候,有时候不知道是什么编码,结果造成了乱码的现象。这里有个非常方便的解决办法,可以自动识别编码并转换为UTF-8。具体...

PHP实现模仿socket请求返回页面的方法

本文实例讲述了PHP实现模仿socket请求返回页面的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:<?php  $url = "www.X...