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图片上传并压缩的实现方法,分享给大家供大家参考,具体内容如下 使用到三个文件 connect.php:连接数据库 test_upload.php:执行SQL...

支持数组的ADDSLASHES的php函数

复制代码 代码如下://SQL ADDSLASHES function saddslashes($string) { if(is_array($string)) { foreach($s...

php实现博客,论坛图片防盗链的方法

本文实例讲述了php实现博客,论坛图片防盗链的方法。分享给大家供大家参考,具体如下: 防盗链的方式很多,我这里就说说我对放盗链的理解,这个跟防止远程提交是一个原理。 先介绍一个函数...

解析array splice的移除数组中指定键的值,返回一个新的数组

使用环境:人才网项目中有一个简历保密设置,其中有一个过滤关键词,只有某个企业的公司名中包含有其中的一个关键字,就不显示该份简历,当然,我还没有做到那里去,现在是要做关键词的增加删除。设想...

PHP正则匹配中英文、数字及下划线的方法【用户名验证】 原创

本文实例讲述了PHP正则匹配中英文、数字及下划线的方法。分享给大家供大家参考,具体如下: 一、问题: 对于用户注册时的用户名要求由中英文、数字或下划线组成,不得含有其他字符。 二、解决方...