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 readfile下载大文件失败的解决方法

本文实例讲述了php readfile下载大文件失败的解决方法。分享给大家供大家参考,具体如下: 大文件有200多M,只下载了200K就提示下载完成,且不报错。 原因是PHP内存有限制,...

php面向对象中static静态属性和静态方法的调用

本文实例讲述了php中static静态属性和静态方法的调用。分享给大家供大家参考。具体如下: 这里分析了php面向对象中static静态属性和静态方法的调用。关于它们的调用(能不能调用,...

PHP开发中AJAX技术的简单应用

AJAX无疑是2005年炒的最热的Web开发技术之一,当然,这个功劳离不开Google。我只是一个普通开发者,使用AJAX的地方不是特别多,我就简单的把我使用的心得说一下。(本文假设用户...

Windows 下的 PHP-PEAR 安装方法

Windows 下的 PHP-PEAR 安装方法

直接下载解压,然后把它放到你的根目录底下,运行之即可(或者也可以使用 PHP CLI 运行它,效果一样): 打包下载地址...

项目中应用Redis+Php的场景

前言 一些案例中有的同学说为什么不可以用string类型,string类型完全可以实现呀 我建议你看下我的专栏文章《Redis高级用法》,里面介绍了用hash类型的好处 商品维度计数...