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权限是否打开,该权限决定了目录能否被浏览。

相关文章

PHPUnit PHP测试框架安装方法

单元测试是几个现代敏捷开发方法的基础,使得PHPUnit成为许多大型PHP项目的关键工具。这个工具也可以被Xdebug扩展用来生成代码覆盖率报告 ,并且可以与phing集成来自动测试,最...

php 计算两个时间戳相隔的时间的函数(小时)

这个是可以具体到小时的php代码复制代码 代码如下:/* Author: 杨宇 yangyu@sina.cn */ //输入两个时间戳,计算差值,也就是相差的小时数,如返回2:10,则表...

PHP使用函数静态变量实现指定迭代次数的方法

本文实例讲述了PHP使用函数静态变量实现指定迭代次数的方法。分享给大家供大家参考,具体如下: 在PHP中,除了类的静态成员属性外,在函数中同样可以利用 static 定义静态变量。从而便...

php 实现多个文件打包成zip压缩包下载的函数

PHP ZipArchive是PHP自带的扩展类,可以轻松实现ZIP文件的压缩和解压,使用前首先要确保PHP ZIP扩展已经开启,不同的平台开启PHP扩增的方法网上都有。/**  *&nb...

PHP安全性漫谈

PHP安全性漫谈

一、apache server安全性设置 1、以Nobody用户运行 一般情况下,Apache是由Root 来安装和运行的。如果Apache Server进程具有Root用户特权,那么它...