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截取utf-8中文字符串乱码的解决方法

复制代码 代码如下:function utf8_substr($str,$len) {   for($i=0;$i<$len;$i++)   {     $temp_str=sub...

关于php程序报date()警告的处理(date_default_timezone_set)

在写php程序中有时会出现这样的警告: PHP Warning: date(): It is not safe to rely on the system's timezone sett...

php去掉URL网址中带有PHPSESSID的配置方法

这种情况主要是出现在Linux平台下才能出现,主要是因为php.ini中session.use_trans_sid 配置的问题。 设置php.ini中的session.use_trans...

PHP生成及获取JSON文件的方法

PHP生成及获取JSON文件的方法

本文实例讲述了PHP生成及获取JSON文件的方法。分享给大家供大家参考,具体如下: 首先定义一个数组,然后遍历数据表,把相应的数据放到数组中,最后通过json_encode()转化数组...

ThinkPHP模型详解

模型定义,默认情况下,ThinkPHP的模型类是位于/Home/Model/目录之下,模型类通常需要继承系统的\Think\Model类或其子类,下面是一个Home\Model\User...