PHP脚本中include文件出错解决方法

yipeiwu_com5年前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提交表单失败后如何保留填写的信息一些方法总结,其中最常用的就是使用缓存方式了,这种方法如果网速慢是可能出问题的,最好的办法就是使用ajax了。 1.使用header头设置缓...

PHP中opcode缓存简单用法分析

本文实例讲述了PHP中opcode缓存简单用法。分享给大家供大家参考,具体如下: 1.什么是opcode 解释器分析代码之后,生成可以直接运行的中间代码,就称做操作码,opcode 2....

php适配器模式介绍

php适配器模式介绍

要点: 1. 适配器模式主要应用于“希望复用一些现存的类,但是接口又与复用环境要求不一致的情况”,在遗留代码复用、类库迁移等方面非常有用。 2. 适配器模式有对象适配器和类适配器两种形式...

php 生成文字png图片的代码

复制代码 代码如下: <? /* php生成文字png图片,可以使用如下方式调用函数: http://www.yourdomian.com/text_png.php3?msg=he...

php分割合并两个字符串的函数实例

本文实例讲述了php分割合并两个字符串的函数。分享给大家供大家参考。具体实现方法如下: 这里实现把两个字符串进行分割合并,例如str1=aaaa,str2=bbbb,合并后生成ababa...