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的优缺点

一、优点 1. 跨平台,性能优越,跟Linux/Unix结合别跟Windows结合性能强45%,并且和很多免费的平台结合非常省钱,比如LAMP(Linux /Apache/Mysql/P...

php使用pecl方式安装扩展操作示例

本文实例讲述了php使用pecl方式安装扩展操作。分享给大家供大家参考,具体如下: 安装pecl cd /usr/local/php/bin/ wget http://pear.ph...

php获取excel文件数据

很简单就可以实现,下面为大家简单介绍下 1、下载PHPExcel类,是一个文件夹,还得有一个文件PHPExcel.php,两个在同级目录 require __DIR__ . './P...

PHP实现的简单网络硬盘

本文实例讲述了PHP实现的简单网络硬盘。分享给大家供大家参考。具体如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transi...

php中get_defined_constants函数用法实例分析

本文实例讲述了php中get_defined_constants函数用法。分享给大家供大家参考。具体分析如下: get_defined_constants ( PHP 4中 > =...