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访问带有密码的Redis方法示例

一、首先设置Redis密码,以提供远程登陆 打开redis.conf配置文件,找到requirepass,然后修改如下: requirepass yourpassword you...

php 中英文语言转换类代码

起初想到制成XML文档形式,这样操作也起来很容易。只是看到说XML效率不怎样 再者就是不同的模板,可这样也有个小问题,有些词汇比如时间提示是不确定,与可能是minute ,day。也有可...

phpmyadmin 3.4 空密码登录的实现方法

因为我把php升级到了5.3.1,以前的phpmyadmin版本不能用了,就升级到phpMyAdmin 3.2.4版的时候,会遇到无法以空密码登录root用户的情况。怎么解决呢? 请参照...

PHP递归遍历文件夹去除注释并压缩php源代码的方法示例

本文实例讲述了PHP递归遍历文件夹去除注释并压缩代码的方法。分享给大家供大家参考,具体如下: <?php // ===================文件夹 递归 去除...