[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' => '',
],
最佳答案
