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导出Excel的小经验 完美解决乱码问题

我在PHP项目里要求把数据导出为Excel,并且数据中包含中文.网上大概了解一下可是使用PHPExcel,可是相对我的需求,这个框架太复杂了.于是还是想找找简单做法.网上发现其实最简单可...

利用php输出不同的心形图案

利用php输出不同的心形图案

首先为大家分享php输出心形曲线的代码,代码如下 <?php for($t=0;$t<360;$t++) { $y=2*cos($t)-cos(2*$t); /...

Linux下快速搭建php开发环境

Linux下快速搭建php开发环境

一、Linux下快速搭建php开发环境 1.安装XAMPP for Linux XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包,使用XAMPP可快...

分享一则PHP定义函数代码

先贴代码 复制代码 代码如下: <?php     function table(){     &nb...

PHP数组传递是值传递而非引用传递概念纠正

在调用函数时通过将PHP数组作为实参赋给形参,在函数中修改,并不会影响到数组本身。 说明此过程中的传递为值传递,数组变量并非是指向此数组本身的引用,PHP数组本身以值的形式存在,同时形参...