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实现获取文件后缀名的几种常用方法

本文实例讲述了PHP实现获取文件后缀名的几种常用方法。分享给大家供大家参考。具体如下: 方法1: function get_file_type($filename){ $type...

php异常:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE eval()'d code error

复制代码 代码如下: 1.调用模板中的判断语句不正确。 2.调用php或SiteEngine的一些函数不正确。 3.一些单引号或双引号引起的问题。...

php文件操作相关类实例

本文实例讲述了php文件操作相关类。分享给大家供大家参考。具体如下: <?php class file_dir { function check_exist($...

PHP基于面向对象封装的分页类示例

本文实例讲述了PHP基于面向对象封装的分页类。分享给大家供大家参考,具体如下: <?php class Page { protected $num;//...

php echo()和print()、require()和include()函数区别说明

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