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页面跳转操作实例分析(header方法)

本文实例分析了PHP页面跳转操作。分享给大家供大家参考,具体如下: 跳转 header()为php函数,向浏览器发送指定命令 html: <meta http-equiv="...

PHP实现的简单对称加密与解密方法实例小结

本文实例讲述了PHP实现的简单对称加密与解密方法。分享给大家供大家参考,具体如下: 方法一:YII自带的加密方法 /** * 加密 * @var string [要加密的值] */...

php google或baidu分页代码

复制代码 代码如下:<?php /** 作者:潇湘博客 时间: 2009-11-26 php技术群: 37304662 使用方法: include_once'Pager.class...

WordPress用户登录框密码的隐藏与部分显示技巧

WordPress用户登录框密码的隐藏与部分显示技巧

让WordPress登录页的密码框显示最后一个输入的字符 在通常情况下,网页的设计者们会将密码输入框中的所有字符隐藏成黑点,以防止有人在背后偷窥输入的密码,如: 这种密码输入模式虽然...

php使用cookie保存登录用户名的方法

本文实例讲述了php使用cookie保存登录用户名的方法。分享给大家供大家参考。具体如下: 提交表单页面 复制代码 代码如下:<?php $user = isset($_C...