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批量任务处理 PHP在批量处理任务的时候会超时,其实解决方法很简单了,就是把任务分割,一次处...

php实现构建排除当前元素的乘积数组方法

构建乘积数组 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*.....

PHP和Shell实现检查SAMBA与NFS Server是否存在

通常会通过 /etc/fstab 来处理挂载的设置,然后再使用 mount -a 来重新确认挂载,最好在排程的程序用到挂载目录时也执行一次 mount -a,挂载目录在断线后是不会自动回...

php根据命令行参数生成配置文件详解

像npm, composer等工具,在开始使用的使用,都需要初始化项目,生成一个项目的配置文件。这种功能的原理是怎么实现的呢? 比如: D:\>npm init --yes W...

PHP入门教程之面向对象基本概念实例分析

本文实例讲述了PHP面向对象基本概念。分享给大家供大家参考,具体如下: Demo1.php <?php //怎样去创建一个类 格式:修饰符 class 类名{}...