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内部使用zval来保存任意类型的数值, zval的结构如下(5.2为例): struct _zval...

windows中PHP5.2.14以及apache2.2.16安装配置方法第1/2页

首先下载好需要安装的配置文件1、apache-2.2.162、php-5.2.14-Win32 一、apache配置 apache的安装不说了,安装过程中选择自己想安装的位置,一路nex...

解析phpstorm + xdebug 远程断点调试

XDEBUG配置:1.安装 xdebug 略了。网上有很多资料。 重点写php.ini的配置 [XDebug]复制代码 代码如下:zend_extension="/usr/lib/php...

检查url链接是否已经有参数的php代码 添加 ? 或 &

比如分页,因为有些链接已经有参数了,在附加分页信息的时候不能把原有的参数丢掉,所以判断一下链接是否有参数,然后根据需要附加分页信息。 方法很简单: 复制代码 代码如下:((strpos(...

PHP排序算法之堆排序(Heap Sort)实例详解

PHP排序算法之堆排序(Heap Sort)实例详解

本文实例讲述了PHP排序算法之堆排序(Heap Sort)。分享给大家供大家参考,具体如下: 算法引进: 在这里我直接引用《大话数据结构》里面的开头: 在前面讲到 简单选择排序 ,它在待...