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已经前前后后一年多了,研究和使用Linux系统也差不多一年了,我居然不...

浅谈ThinkPHP的URL重写

我想要的结果无非是去掉URL路径中的index.php 首先是配置.htaccess 复制代码 代码如下: <IfModule mod_rewrite.c> RewriteE...

CakePHP去除默认显示的标题及图标的方法

去除的办法是: 修改cake\libs\view\templates\layouts\default.thtml,这个是视图文件的通用模板框架(带头部和脚部)。 另外: cakephp视...

PHP与SQL注入攻击[一]

Haohappy http://blog.csdn.net/Haohappy2004 SQL注入攻击是黑客攻击网站最常用的手段。如果你的站点没有使用严格的用户输入检验,那么非常容易遭到S...

php验证码生成代码

验证码通常是用来安全保证我们网站注册或登录不被注入的,但为了更安全我们通常会生成一些混合验证码了,下面一起来看看例子. 在我们开发登录模块或者是论坛的灌水模块的时候,为了防止恶意提交,需...