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使用Header函数,PHP_AUTH_PW和PHP_AUTH_USER做用户验证

本文实例讲述了php使用Header函数,PHP_AUTH_PW和PHP_AUTH_USER做用户验证的方法。分享给大家供大家参考,具体如下: 在php中,可以使用Header函数做一些...

PHP获得数组交集与差集的方法

本文实例讲述了PHP获得数组交集与差集的方法。分享给大家供大家参考。具体分析如下: 一、数组的交集 array_intersect() array_intersect()函数返回一个保留...

php中使用addslashes函数报错问题的解决方法

大家看下面的代码,能发现错误在哪里吗? 复制代码 代码如下:<?phpecho function_exists('addcslashes');//检测是否存在该函数echo get...

IIS6.0中配置php服务全过程解析

虽然 LAMP 组合很不错,但是如果想要架设一台同时支持 PHP、ASP、ASP.NET、JSP、Perl 的 Web 虚拟主机服务器,还是用 Windows 2003 的 IIS 6...

PHP实现将标点符号正则替换为空格的方法

本文实例讲述了PHP实现将标点符号正则替换为空格的方法。分享给大家供大家参考,具体如下: <?php $character = "!@#$%^&*中'文中'文中'文()...