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权限是否打开,该权限决定了目录能否被浏览。

相关文章

Erlang的运算符(比较运算符,数值运算符,移位运算符,逻辑运算符)

Erlang的比较运算符 opDescription==等于/=不等于=<小于等于<小于>=大于等于>大于=:=精确的等于=/=精确的不等于等于和精确等于的区别:...

可兼容php5与php7的cURL文件上传功能实例分析

本文实例讲述了可兼容php5与php7的cURL文件上传功能。分享给大家供大家参考,具体如下: 为啥要写这个示例 最近修改一个项目,需要通过cURL上传文件。 记得之前做过类似实现的,于...

PHP树形结构tree类用法示例

PHP树形结构tree类用法示例

本文实例讲述了PHP树形结构tree类用法。分享给大家供大家参考,具体如下: <?php include 'tree.class.php'; //模拟数据库 $data...

php下实现折线图效果的代码

<?php   Class ImageReport{  var $X;//图片大小X轴  var $Y;//图...

PHP实现带进度条的Ajax文件上传功能示例

PHP实现带进度条的Ajax文件上传功能示例

本文实例讲述了PHP实现带进度条的Ajax文件上传功能。分享给大家供大家参考,具体如下: 之前分享了一篇关于 php使用FileApi实现Ajax上传文件 的文章,里面的Ajax文件上传...