Laravel : Redis 无法建立连接 : [tcp://127.0.0.1:6379]
我已经通过添加 ,"predis/predis":"~1.0"
然后为了测试,我添加了以下代码:
public function showRedis($id = 1)
{
$user = Redis::get('user:profile:'.$id);
Xdd($user);
}
在应用程序/配置/数据库中.php我有:
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
它会引发以下错误:No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]
我用于该项目。用。virtualhost
Xampp with windows