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

相关文章

thinkphp如何获取客户端IP

thinkphp框架中系统内置了get_client_ip方法用于获取客户端的IP地址,使用示例: $ip = get_client_ip(); 除了thinkphp内置get_cl...

PHP实现生成数据字典功能示例

PHP实现生成数据字典功能示例

本文实例讲述了PHP实现生成数据字典功能。分享给大家供大家参考,具体如下: 最近时间紧迫,没有时间发博客,趁现在有点时间向大家分享一个知识点。在咱们做开发的时候 ,也许经常会遇到对数据库...

深入浅出讲解:php的socket通信原理

深入浅出讲解:php的socket通信原理

对TCP/IP、UDP、Socket编程这些词你不会很陌生吧?随着网络技术的发展,这些词充斥着我们的耳朵。那么我想问: 1.  什么是TCP/IP、UDP? 2. ...

PHP统计目录下的文件总数及代码行数(去除注释及空行)

<?php /** * @author xiaoxiao <x_824@sina.com> 2011-1-12 * @link http://xiaoyaoxia.cn...

PHP实现字符串翻转功能的方法【递归与循环算法】

PHP实现字符串翻转功能的方法【递归与循环算法】

本文实例讲述了PHP实现字符串翻转功能的方法。分享给大家供大家参考,具体如下: 提到实现字符串反转的方法,大家都会想到用循环。确实,循环是一个内存占用量小且实现简单的方式。但是还有一种方...