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

相关文章

解析如何修改phpmyadmin中的默认登陆超时时间

登录后1440秒未活动后总是自动退出,一天还要登录多次,终于有时间来解决这个问题了,感觉是session超时,结果在网上search了下,找到解决办法啦,哈哈哈,在此做个笔记:phpmy...

wamp安装后自定义配置的方法

WampServer是目前应用非常广泛的PHP集成开发环境,本文就来讲述Wamp安装后自定义配置的方法。供大家参考借鉴。具体如下: wamp2.5安装完毕后,自己手动重新设置了apach...

PHP实现的浏览器检查类

本文实例讲述了PHP实现的浏览器检查类。分享给大家供大家参考,具体如下: <?php //原作者:epsilon7 //SonyMusic([email]sonymus...

深思 PHP 数组遍历的差异(array_diff 的实现)

function array_diff($array_1, $array_2) {     $diff =...

php通过Chianz.com获取IP地址与地区的方法

本文实例讲述了php通过Chianz.com获取IP地址与地区的方法。分享给大家供大家参考。具体分析如下: 一个IP获取的结果不是很完善,究其原因是因为ip138的IP解析应对国外的地址...