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高级编程实例:编写守护进程

1.什么是守护进程 守护进程是脱离于终端并且在后台运行的进程。守护进程脱离于终端是为了避免进程在执行过程中的信息在任何终端上显示并且进程也不会被任何终端所产生的终端信息所打断。 例如 a...

php做下载文件的实现代码及文件名中乱码解决方法

最近有人问我做下载文件的方法,对于php方法如下: 复制代码 代码如下: <?php header("Content-Type: application/force-downloa...

php输入流php://input使用浅析

在做一个摄像头拍照然后上传的功能,php中使用php://input来获取内容。于是就了解了下php://input。 从官网信息来看,php://input是一个只读信息流,当请求方式...

php部分常见问题总结

目录: 1:为什么我得不到变量 2:调试你的程序 3:如何使用session 4:为什么我向另一网页传送变量时,只得到前半部分,以空格开头的则全部丢失 5:如何截取指定长度汉字而不会出现...

preg_match_all使用心得分享

preg_match_all — 进行全局正则表达式匹配 说明 复制代码 代码如下:int preg_match_all ( string pattern, string subject...