«

thinkphp6报错,原来是Redis没启动

瑞瑞瑞 发布于 阅读:186


0 [0]RedisException in Redis.php line 63

由于目标计算机积极拒绝,无法连接。
$this->options = array_merge($this->options, $options);
}

    if (extension_loaded('redis')) {
        $this->handler = new \Redis;

        if ($this->options['persistent']) {
            $this->handler->pconnect($this->options['host'], (int) $this->options['port'], (int) $this->options['timeout'], 'persistent_id_' . $this->options['select']);
        } else {
            $this->handler->connect($this->options['host'], (int) $this->options['port'], (int) $this->options['timeout']);
        }

        if ('' != $this->options['password']) {
            $this->handler->auth($this->options['password']);
        }
    } elseif (class_exists('\Predis\Client')) {
        $params = [];
        foreach ($this->options as $key => $val) {
            if (in_array($key, ['aggregate', 'cluster', 'connections', 'exceptions', 'prefix', 'profile', 'replication', 'parameters'])) {

今天一直报这个错误,后来才发现是redis没有启动,打开一下,马上就恢复正常了。