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单例模式实现方法分析

本文实例讲述了php单例模式实现方法。分享给大家供大家参考。具体如下: <?php /** * @copyright 2013 maguowei.com * @au...

php传值和传引用的区别点总结

php传值:在函数范围内,改变变量值得大小,都不会影响到函数外边的变量值。 PHP传引用:在函数范围内,对值的任何改变,在函数外部也有所体现,因为传引用传的是内存地址。 传值:和copy...

PHP7扩展开发之hello word实现方法详解

本文实例讲述了PHP7扩展开发之hello word实现方法。分享给大家供大家参考,具体如下: 这里是以PHP7作为基础,讲解如何从零开始创建一个PHP扩展。本文主要讲解创建一个扩展的基...

PHP用户管理中常用接口调用实例及解析(含源码)

PHP用户管理中常用接口调用实例及解析(含源码)

掌握用户的第一步就是将已经关注的粉丝信息保存起来,这个时候就用到获取用户列表接口。公众号可通过本接口来获取帐号的关注者列表,关注者列表由一串OpenID(加密后的微信号,每个用户对每个公...

php中使用session防止用户非法登录后台的方法

本文实例讲述了php中使用session防止用户非法登录后台的方法。分享给大家供大家参考。具体如下: 一般来说,我们登录网站后台时,服务器会把登录信息保存到session文件里,并通过读...