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随机生成福彩双色球号码的2种方法

不瞒您说,俺也是个双色球爱好者,经常买,但迟迟没有中过一等奖,哈哈。这里为大家介绍用php随机生成福彩双色球号码的二种方法,供朋友们学习参考。新的一年,祝大家中大奖,发大财。 方法一复制...

php生成随机数的三种方法

如何用php生成1-10之间的不重复随机数? 例1,使用shuffle函数生成随机数。 <?php $arr=range(1,10); shuffle($arr); f...

php cli 小技巧

php代码: 复制代码 代码如下: <?php var_dump($argv); Shell/批处理代码 复制代码 代码如下: @echo off :BEGIN set /p i...

PHP实现简单实用的验证码类

本文实例讲述了PHP实现简单实用的验证码类。分享给大家供大家参考。具体如下: <?php /** * @version 1.0 * @author bolted sn...

PHP实现图片的等比缩放和Logo水印功能示例

本文实例讲述了PHP实现图片的等比缩放和Logo水印功能。分享给大家供大家参考,具体如下: /** * 等比缩放函数(以保存的方式实现) * @param string $pic...