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 IP转换整形(ip2long)的详解

如何将四个字段以点分开的IP网络址协议地址转换成整数呢?PHP里有这么一个函数ip2long.比如复制代码 代码如下:<?phpecho ip2long("10.2.1.3");?...

PHP实现创建微信自定义菜单的方法示例

本文实例讲述了PHP实现创建微信自定义菜单的方法。分享给大家供大家参考,具体如下: 在使用通用接口前,你需要做以下两步工作: 1.拥有一个微信公众账号,并获取到appid和appsecr...

PHP实现批量修改文件后缀名的方法

本文实例讲述了PHP实现批量修改文件后缀名的方法。分享给大家供大家参考。具体如下: /** * 批量修改文件后缀名 * @param $path 文件夹路径 * @param...

php array_filter除去数组中的空字符元素

除去数组中的空字符元素 复制代码 代码如下: <?php $str1_array=array('【宜配屋www.yipeiwu.com】','','//www.jb51.net',...

PHP进阶学习之Geo的地图定位算法详解

PHP进阶学习之Geo的地图定位算法详解

本文实例讲述了PHP进阶学习之Geo的地图定位算法。分享给大家供大家参考,具体如下: 前言 日常开发中我们经常需要查找某个物体的定位,或者查找附近的范围等,我们自然而然会想到的方法就是...