PHP脚本中include文件出错解决方法_PHP
程序员文章站
2024-01-06 09:32:46
...
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权限是否打开,该权限决定了目录能否被浏览。
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脚本中include文件报错解决方法
-
html网页中插入script脚本,src指向php文件,怎么在html中显示php返回的数据?求大神赐教。
-
php将/data/www/site1/image目录中的图片文件缩小成800*600像素的图片解决方法
-
php中让上传的文件大小在上传前就受限制的两种解决方法
-
php include_once引入的文件中的变量不能使用
-
跨浏览器下PHP下载文件名中的中文乱码问题的解决方法
-
实测在class的function中include的文件中非php的global全局环境
-
ishare.iask.sina.com.cn PHP脚本中include文件出错解决方法
-
php 中require和include引用url和 php的文件编码转换函数问题
-
跨浏览器PHP下载文件名中的中文乱码问题解决方法