thinkphp5 redis 错误的SESSION处理器类

浏览:4236 发布日期:2017/12/13 分类:求助交流 关键字: redis
[0] ClassNotFoundException in Session.php line 102
错误的SESSION处理器类:\think\session\driver\Redis
        if (isset($config['cache_expire'])) {
            session_cache_expire($config['cache_expire']);
        }
        if (!empty($config['type'])) {
            // 读取session驱动
            $class = false !== strpos($config['type'], '\\') ? $config['type'] : '\\think\\session\\driver\\' . ucwords($config['type']);

            // 检查驱动类
            if (!class_exists($class) || !session_set_save_handler(new $class($config))) {
                throw new ClassNotFoundException('error session handler:' . $class, $class);
            }
        }
        if ($isDoStart) {
            session_start();
            self::$init = true;
        } else {
            self::$init = false;
        }
    }
config.php    'session'                => [

        'prefix' => '',
        'type' => 'redis',
        'auto_start' => true,
        // redis主机
        'host' => '192.168.0.135',
        // redis端口
        'port' => 6379,
        // 密码
        'password' => '',
    ],
最佳答案
评论( 相关
后面还有条评论,点击查看>>