php脚本中include文件报错解决方法
2009-02-02 16:07
591 查看
经常当php页面中利用include, require, require_once包含了一些其他位置的页面时,会出现错误,比如没有发现次页面,或者权限不允许等,可以根据以下方法来排除
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/1z0-147 .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权限是否打开,该权限决定了目录能否被浏览。
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/1z0-147 .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脚本中include文件出错解决方法
- PHP脚本中include文件出错解决方法
- 网页中PHP脚本中include文件报错解决方法
- PHP脚本中include文件出错解决方法
- php命令行(cli)下执行PHP脚本文件的相对路径的问题解决方法
- IIS7配置PHP5.5 对找不到的文件启用文件监视的解决方法[原创]_win服务器_脚本之家
- php命令行(cli)下执行PHP脚本文件的相对路径的问题解决方法
- php上传大于2M文件的解决方法
- php无法上传大文件的解决方法
- PHP Fckeditor上传文件(或图片)中文显示为乱码的解决方法
- PHP 关于include()和require()方法加载文件的区别
- [乐意黎原创]PHP 写入文件时抛failed to open stream:Permission denied in 错误的解决方法
- PHP和Nginx 文件上传大小限制问题解决方法
- php上传文件中文文件名乱码的解决方法
- 解决织梦 \include\userlogin.class.php on line 21 报错的方法
- LNMP一键安装包PHP和Niginx 文件上传大小限制问题解决方法
- PHPMyAdmin导入时提示文件大小超出PHP限制的解决方法
- php读取csv文件后,uft8 bom导致在页面上显示出现问题的解决方法
- php相对当前文件include其它文件的方法
- CentOS #include <uuid/uuid.h> 找不到文件解决方法