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中用数组的方法设置cookies

复制代码 代码如下: <?php         function set_cronology($name,$value,$duration...

PHP使用标准库spl实现的观察者模式示例

本文实例讲述了PHP使用标准库spl实现的观察者模式。分享给大家供大家参考,具体如下: 前面使用纯php实现了一个观察者模式(php观察者模式), 现在使用php标准库spl在次实现观察...

php安装ssh2扩展的方法【Linux平台】

本文实例讲述了php安装ssh2扩展的方法。分享给大家供大家参考,具体如下: wget http://www.libssh2.org/download/libssh2-1.4.2.t...

php绘图中显示不出图片的原因及解决

php绘图首先要确认gd库是否启用,到php.ini文件中,找到extension=php_gd2.dll将前面的;去掉,重新启动服务器。 如果在绘图中还是没有显示正常的图片,说明服务器...

PHP的curl实现get,post和cookie(实例介绍)

类似于dreamhost这类主机服务商,是显示fopen的使用 的。使用php的curl可以实现支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DI...