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手册上有这么一段话: “在处理字符变量的算数运算时,PHP 沿袭了 Perl 的习惯,而非 C 的。例如,在 Perl 中 $a = 'Z'; $a++; 将把 $a 变成...

关于PHP二进制流 逐bit的低位在前算法(详解)

复制代码 代码如下:  /******************************************************   &nb...

PHP中define() 与 const定义常量的区别详解

本文实例讲述了PHP中define() 与 const定义常量的区别。分享给大家供大家参考,具体如下: 前言 今天在Stackoverflow又看到一个很有趣的文章,所以翻译过后摘了过来...

php中用memcached实现页面防刷新功能

有个新需求要加上去,防止用户频繁刷新页面。具体需求是当用户在一分钟之后内请求指定的页面超过100次,就直接拒绝请求。仔细分析后发现这个功能用memcache来做最方便: 1、以用户IP和...

php使用正则表达式进行字符串搜索的方法

本文实例讲述了php使用正则表达式进行字符串搜索的方法。分享给大家供大家参考。具体实现方法如下: <?php $string_to_search = "jb51.net...