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

相关文章

解决出现SoapFault (looks like we got no XML document)的问题

今天在调试项目的时候出现下面的错误信息: SoapFault looks like we got no XML document (D:\phpStudy\WWW\self.sho...

web站点获取用户IP的安全方法 HTTP_X_FORWARDED_FOR检验

安全过滤后的getIP函数 复制代码 代码如下:  function getIP() { $realip = ''; //设置默认值 if (isset($...

PHP7内核之Reference详解

PHP7内核之Reference详解

问题 上一章说过引用(REFERENCE)在PHP5的时候是一个标志位, 而在PHP7以后我们把它变成了一种新的类型:IS_REFERNCE. 然而引用是一种很常见的应用, 所以这个变化...

一个PHP模板,主要想体现一下思路

思路: 欲在速度和易用(主要指的是美工设计的方便性)之间取得一个平衡点.于是采用了由html文件生成php文件的办法(编译?) 也想在分离显示逻辑和分离html代码之间平衡一下 例如一个...

24条货真价实的PHP代码优化技巧

 PHP代码优化24条真经,希望对大家开发php项目有所帮助,具体内容如下  1.echo比print快。  2.使用echo的多重参数代替字符串连接。...