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 PDO的一些认识小结

1、PDO(PHP Data Object)扩展为PHP定义了一个访问数据库的轻量、持久的接口。实现PDO接口的每一种数据库驱动都能以正则扩展的形式把各自的特色表现出来。 主要:PDO扩...

php中怎么搜索相关联数组键值及获取之

1.搜索关联数组键如果在一个数组中找到一个指定的键,函数array_key_exists()返回TRUE,否则返回FALSE。其 形式如下:boolean array_key_exist...

PHP 过滤页面中的BOM(实现代码)

复制代码 代码如下:function checkBOM ($filename) {       $contents = fil...

THINKPHP+JS实现缩放图片式截图的实现

THINKPHP+JS实现缩放图片式截图的实现

作者:杨鑫奇 原始链接:http://www.cnblogs.com/scotoma/archive/2010/03/05/1679477.html 今晚TP论坛的一位大哥加我了,说也遇...

PHP单例模式模拟Java Bean实现方法示例

PHP单例模式模拟Java Bean实现方法示例

本文实例讲述了PHP单例模式模拟Java Bean实现方法。分享给大家供大家参考,具体如下: 问题: 根据如下杨辉三角形 实现一个get_value($row,$col)方法: (前一...