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中使用explode查找某个字符是否存在的方法

这个方法同样可以用于判断是否有该分隔符号。例如: 复制代码 代码如下: <?php if($_MODULE[tg1_tjly]){ $tg1_tjly = explode("|",...

php实现与python进行socket通信的方法示例

本文实例讲述了php实现与python进行socket通信的方法。分享给大家供大家参考,具体如下: 设计目的 通过前端页面发起请求交给php,php创建socket请求交给Python脚...

什么是OneThink oneThink后台添加插件步骤

什么是OneThink oneThink后台添加插件步骤

OneThink以其便捷的建站、丰富的扩展、灵活的二次开发,以及云服务的支持,为广大个人和企业建站带来新的契机和机遇,即将成为互联网新的弄潮儿。 OneThink特性介绍: 1. 基于T...

php的XML文件解释类应用实例

本文实例讲述了php的XML文件解释类及其用法,是非常实用的技巧。分享给大家供大家参考。具体如下: XMLParser.class.php类文件如下: <?php /...

php错误提示failed to open stream: HTTP request failed!的完美解决方法

google或者baidu一下,好多这样的问题,解决的方法都是修改php.ini,把allow_url_fopen给启用,改成 allow_url_fopen = On 这样做可以解决某...