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实现过滤各种HTML标签

首先分享一些比较常见的 $str=preg_replace("/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]*...

phpMyAdmin通过密码漏洞留后门文件

phpMyAdmin通过密码漏洞留后门文件

默认 phpMyAdmin:用户名 root 密码 root 或空登陆。 版本 2.11.3~2.11.4:用户名 'localhost'@'@" 登陆,无需密码。 版本...

使用PHP访问RabbitMQ消息队列的方法示例

本文实例讲述了使用PHP访问RabbitMQ消息队列的方法。分享给大家供大家参考,具体如下: 扩展安装 PHP访问RabbitMQ实际使用的是AMQP协议,所以我们只要安装epel库中的...

php实现图片等比例缩放代码

新建文件index.php,需要在统计目录下有个图片为q.jpg(可根据源码进行更改图片的名称) 源代码如下: <?php $filename="q.jpg"; $pe...

php实现不通过扩展名准确判断文件类型的方法【finfo_file方法与二进制流】

本文实例讲述了php实现不通过扩展名准确判断文件类型的方法。分享给大家供大家参考,具体如下: 第一种方法 通过php的finfo_file() $handle=finfo_open(...