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 class Timer//页面执行时间类 { var starttime;//页面开始执行时间 var stoptime;//页面结束执行...

php中使用Curl、socket、file_get_contents三种方法POST提交数据

抓取远程内容,之前一直都在用file_get_content函数,其实早就知道有curl这么一个好东西的存在,但是看了一眼后感觉使用颇有些复杂,没有file_get_content那么简...

UCenter Home二次开发指南

前言本文将就UCH二次开发这个核心主题,以各种实现的代码为主,辅助部分说明概略的讲解如何针对UCH进行二次开发。过段时间UCH就开源了,准备到时候再详细的写篇UCH机制分析。 顺便说下,...

深入Apache与Nginx的优缺点比较详解

1、nginx相对于apache的优点:  轻量级,同样起web 服务,比apache占用更少的内存及资源  抗并发,nginx 处理请求是异步非...

PHP使用 Pear 进行安装和卸载包的方法详解

PHP使用 Pear 进行安装和卸载包的方法详解

本文实例讲述了PHP使用 Pear 进行安装和卸载包的方法。分享给大家供大家参考,具体如下: 安装: 首先运行到php根目录: 输入要安装的包文件名: 使用语法: pear...