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 callback函数使用方法和注意事项

在PHP中有些诸如 call_user_function() 或 usort() 的函数接受用户自定义的函数作为一个参数。Callback 函数不仅可以是一个简单的函数,它还可以是一个对...

一个简洁实用的PHP缓存类完整实例

本文完整描述了一个简洁实用的PHP缓存类,可用来检查缓存文件是否在设置更新时间之内、清除缓存文件、根据当前动态文件生成缓存文件名、连续创建目录、缓存文件输出静态等功能。对于采用PHP开发...

php函数的常用方法及注意之处小结

复制代码 代码如下: <?php /** * @author Yuans * @copyright php.com * @package 函数的常用使用方法及特性. */ # 基础...

PHP实时统计中文字数和区别

1、PHP 中如何正确统计中文字数?这个是困扰我很久的问题,PHP 中有很多函数可以计算字符串的长度,比如下面的例子,分别使用了 strlen,mb_strlen,mb_str...

微信公众平台开发关注及取消关注事件的方法

本文实例讲述了微信公众平台开发关注及取消关注事件的方法。分享给大家供大家参考。具体分析如下: 用户在关注与取消关注公众号时,微信会把这个事件推送到开发者填写的URL,方便开发者给用户下发...