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

相关文章

完美解决thinkphp唯一索引重复时出错的问题

完美解决thinkphp唯一索引重复时出错的问题

比如如下字段(g_check_id):唯一索引 如果插入数据时(g_check_id)出现相同的值的话,程序本身是会报错的。 所以做类似如下处理: 以上这篇完美解决thinkphp...

php7新特性的理解和比较总结

php7新特性的理解和比较总结

1. null合并运算符(??) 语法: 如果变量存在且值不为NULL,它就会返回自身的值,否则返回它的第二个操作数. //php7以前 if判断 if(emp...

php遍历目录方法小结

本文实例总结了php遍历目录方法。分享给大家供大家参考。具体如下: 1. 方法1     <?php function...

php实现的通用图片处理类

本文实例讲述了php实现的通用图片处理类。分享给大家供大家参考。具体如下: 该图片处理函数功能:缩放、剪切、相框、水印、锐化、旋转、翻转、透明度、反色,处理并保存历史记录的思路:当有图片...

PHP错误抑制符(@)导致引用传参失败Bug的分析

看下面的例子: 复制代码 代码如下: <?php $array = array(1,2,3); function add (&$arr) { $arr[] = 4; } add(@...