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面向对象五大原则之开放-封闭原则(OCP)详解

本文实例讲述了PHP面向对象五大原则之开放-封闭原则(OCP)。分享给大家供大家参考,具体如下: 1. 什么是“开放-封闭” 随着软件系统规模的不断增大,软件系统的维护和修改的复杂性不断...

php中jpgraph类库的使用介绍

用Jpgraph,只要了解它的一些内置函数,可以轻松得画出折线图、柱形图、饼状图等图表。 首先要保证PHP打开了Gd2的扩展: 打开PHP.ini,定位到extension=php_gd...

解析PHP中的内存管理,PHP动态分配和释放内存

解析PHP中的内存管理,PHP动态分配和释放内存

摘要 内存管理对于长期运行的程序,例如服务器守护程序,是相当重要的影响;因此,理解PHP是如何分配与释放内存的对于创建这类程序极为重要。本文将重点探讨PHP的内存管理问题。 一、 内存在...

php验证手机号码(支持归属地查询及编码为UTF8)

复制代码 代码如下: <?php // 手机号验证 function checkMobileValidity($mobilephone){ $exp = "/^13[0-9]{1}...

url decode problem 解决方法

试验了一下python的urllib库以及js 的 encodeURIComponent 均不会替换。空格encode也是替换成了 '%20' 。python提供了urllib.quot...