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 Class SoapClient not found解决方法

要用到 SoapClient, new 了一个提示 Class ‘SoapClient' not found, 检查了下 phpinfo, 原因是当初没有编译这个扩展, 只好现在再加上了...

php array_map使用自定义的函数处理数组中的每个值

array_map 将回调函数作用到给定数组的单元上。 说明 array array_map ( callable $callback , array $arr1 [, array $....

php中删除数组的第一个元素和最后一个元素的函数

对于一个php数组,该如何删除该数组的第一个元素或者最后一个元素呢?其实这两个过程都可以通过php自带的函数 array_pop 和 array_shift 来完成,下面就具体介绍一下如...

php合并数组array_merge函数运算符加号与的区别

array_merge在参考手册中的说明如下: array_merge() 将两个或多个数组的单元合并起来,一个数组中的值附加在前一个数组的后面。返回作为结果的数组。 如果输入的数组中有...

PHP实现字节数Byte转换为KB、MB、GB、TB的方法 原创

PHP实现字节数Byte转换为KB、MB、GB、TB的方法 原创

本文实例讲述了PHP实现字节数Byte转换为KB、MB、GB、TB的方法。分享给大家供大家参考,具体如下: 前面介绍了java实现字节数Byte转换为KB、MB、GB、TB的方法 ,这里...