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 $array1 = array("A","B","C","D"); $arr...

WordPress中注册菜单与调用菜单的方法详解

register_nav_menus()(注册菜单) register_nav_menus() 函数用来注册一个菜单,菜单指的是 WordPress 3.0+ 的菜单管理器,注册之后用户...

PHP使用Session实现上传进度功能详解

本文实例讲述了PHP使用Session实现上传进度功能。分享给大家供大家参考,具体如下: 实现文件上传进度条基本是依靠JS插件或HTML5的File API来完成,其实PHP配合ajax...

PHP代码优化之成员变量获取速度对比

有如下4个代码示例,你认为他们创建对象,并且获得成员变量的速度排序是怎样的? 1:将成员变量设置为public,通过赋值操作给成员变量赋值,直接获取变量复制代码 代码如下:<?ph...

PHP编程中八种常见的文件操作方式

文件和目录的操作 PHP处理本地服务器上的文件和目录是非常方便的,但有时候会出现权限和路径相关的问题 1.打开文件 resource fopen (...