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权限是否打开,该权限决定了目录能否被浏览。

相关文章

详解phpmyadmin相关配置与错误解决

详解phpmyadmin相关配置与错误解决 缺少mcrypt扩展 sudo apt-get install php5-mcrypt sudo php5enmod mcrypt 检查:...

PHP符合PSR编程规范的实例分享

前言 关于开发标准这块,可以说一直都是风格迥异,各家都有各家的玩法,民间更是个人玩个人的。目前我们国内比较出名的几个框架(Yii,Laravel) 都已经支持Composer并且加入了P...

让PHP以ROOT权限执行系统命令的方法

用来作为解决php以root权限执行一些普通用户不能执行的命令或应用的参考。 其实php里的popen()函数是可以解决这个问题的,但是由于某些版本的linux(如我使用的Centos...

将word转化为swf 如同百度文库般阅读实现思路及代码

将word转化为swf 如同百度文库般阅读实现思路及代码

复制代码 代码如下: <SPAN style="FONT-FAMILY: Arial, Helvetica, sans-serif">实现如同百度文库那样类似功能需要进行一系...

PHP实现生成带背景的图形验证码功能

本文实例讲述了PHP实现生成带背景的图形验证码功能。分享给大家供大家参考,具体如下: 以前我们利用php生成的都是无背景或同一色彩背景的验证码了,但这种验证容易给机器识别了,这里就来介绍...