用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1334|回复: 5
收起左侧

[HELP] 网站突然出现属性未定义Notice: Undefined variable: file

[复制链接]
发表于 2016-6-29 14:04:40 | 显示全部楼层 |阅读模式
网站已正常运行8个月左右,最近偶尔出现错误提示,不是404,而是直接在页面显示错误,如下:
Notice: Undefined variable: file in /alidata/www/ubscredit/system/core/CodeIgniter.php on line 105 Warning: fopen(): Filename cannot be empty in /alidata/www/ubscredit/system/core/CodeIgniter.php on line 105
有时候刷新下就好了,这个是什么原因?求大神解答
发表于 2016-6-29 14:07:36 | 显示全部楼层
这只是个提示而已,看看 105 行是什么内容
 楼主| 发表于 2016-6-29 14:12:45 | 显示全部楼层
Hex 发表于 2016-6-29 14:07
这只是个提示而已,看看 105 行是什么内容

if ( ! is_php('5.4'))
{
        ini_set('magic_quotes_runtime', 0);

        if ((bool) ini_get('register_globals'))
        {
                $_protected = array(
                        '_SERVER',
                        '_GET',
                        '_POST',
                        '_FILES',
                        '_REQUEST',
                        '_SESSION',
                        '_ENV',
                        '_COOKIE',
                        'GLOBALS',
                        'HTTP_RAW_POST_DATA',
                        'system_path',
                        'application_folder',
                        'view_folder',
                        '_protected',
                        '_registered'
                );

                $_registered = ini_get('variables_order');
                foreach (array('E' => '_ENV', 'G' => '_GET', 'P' => '_POST', 'C' => '_COOKIE', 'S' => '_SERVER') as $key => $superglobal)
                {
                        if (strpos($_registered, $key) === FALSE)
                        {
                                continue;
                        }

                        foreach (array_keys($$superglobal) as $var)
                        {
                                if (isset($GLOBALS[$var]) && ! in_array($var, $_protected, TRUE))
                                {
                                        $GLOBALS[$var] = NULL;
                                }
                        }
                }
        }
}
红色标注的代码块就是105行,这是CI系统文件
发表于 2016-6-29 14:49:06 | 显示全部楼层
105 行哪有 fopen ?
 楼主| 发表于 2016-6-29 14:57:36 | 显示全部楼层
Hex 发表于 2016-6-29 14:49
105 行哪有 fopen ?

这也是我搞不懂的地方
发表于 2016-6-30 13:58:25 | 显示全部楼层
eason_fly 发表于 2016-6-29 14:57
这也是我搞不懂的地方

你确定是这个文件么。。。PHP 是不会骗人的。。。

本版积分规则