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文件上传的两种实现方法

文件上传一般有下面2种方式: 有两种: 1、标准input表单方式,典型的用$_FILES进行接收; 2、以Base64的方式进行传送,一般是AJAX异步上传。 第一种 标准的input...

54个提高PHP程序运行效率的方法

1.在可以用file_get_contents替代file、fopen、feof、fgets等系列方法的情况下,尽量用 file_get_contents,因为他的效率高得多!但是要注意...

php+html5使用FormData对象提交表单及上传图片的方法

php+html5使用FormData对象提交表单及上传图片的方法

本文实例讲述了php+html5使用FormData对象提交表单及上传图片的方法。分享给大家供大家参考。具体分析如下: FormData 对象,可以把form中所有表单元素的name与v...

php中echo()和print()、require()和include()等易混淆函数的区别

1.echo和print的区别 PHP中echo和print的功能基本相同(输出),但是两者之间还是有细微差别的。echo输出后没有返回值,但print有返回值,当其执行失败时返回fla...

PHP IE中下载附件问题解决方法

重点: 1、在IE中下载附件之前要清空缓存。 2、中文文件名要用urlencode编码。 复制代码 代码如下: Header("Pragma: "); //不加的话,IE中会提示目标主机...