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

相关文章

js和php邮箱地址验证的实现方法

邮箱地址验证有很多方法。在浏览器端,js邮箱验证可以通过正则表达式检测。 比如:复制代码 代码如下:function isEmail(email) {   ...

php绘制一条弧线的方法

本文实例讲述了php绘制一条弧线的方法。分享给大家供大家参考。具体如下: 弧线相当于截取了椭圆的一部分。代码如下: 复制代码 代码如下:<?php //1、创建画布 $im...

PHP爆绝对路径方法收集整理

1、单引号爆路径 说明: 直接在URL后面加单引号,要求单引号没有被过滤(gpc=off)且服务器默认返回错误信息。 Eg: www.xxx.com/news.php?id=149′ 2...

探讨:如何编写PHP扩展

探讨:如何编写PHP扩展

用C/C++扩展PHP的优缺点:优点:效率,还是效率减少PHP脚本的复杂度, 极端情况下, 你只需要在PHP脚本中,简单的调用一个扩展实现的函数,然后你所有的功能都就被扩展实现了而缺点也...

AJAX的跨域访问-两种有效的解决方法介绍

新的W3C策略实现了HTTP跨域访问,还亏我找了很久的资料解决这个问题:只需要在servlet中返回的头部信息中添加Access-Control-Allow-Origin这个既可。比如我...