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 利用Mail_MimeDecode类提取邮件信息示例

重点为one_mail函数。利用Mail_mimeDecode类从邮件中提取邮件头和邮件正文。 复制代码 代码如下: <?php header("content-type:text...

php设计模式 Chain Of Responsibility (职责链模式)

复制代码 代码如下: <?php /** * 职责链模式 * * 为解除请求的发送者和接收者之间的耦合,而使用多个对象都用机会处理这个请求,将这些对象连成一条链,并沿着这条链传递该...

Linux系统下php获得系统分区信息的方法

本文实例讲述了Linux系统下php获得系统分区信息的方法。分享给大家供大家参考。具体实现方法如下: $pars = array_filter(explode("\n",`df -h...

PHP中OpenSSL加密问题整理

最近公司项目中有需要用到OpenSSL的加密和java端进行接口验证,再测试环境升级到PHP7的时候加密会出现错误,后来多方面检查终于找到原因所在: PHP7环境下把openssl_ge...

PHP实现通用alert函数的方法

本文实例讲述了PHP实现通用alert函数的方法。分享给大家供大家参考。具体如下: 函数:通用提示 参数:提示訊息,類型或網址,窗口名或函數名,延时毫秒 Alert("","funct...