I have installed redis with laravel by adding "predis/predis":"~1.0"
,
Then for testing i added the following code :
public function showRedis($id = 1)
{
$user = Redis::get('user:profile:'.$id);
Xdd($user);
}
In app/config/database.php i have :
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
It throws the following error : No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]
I using virtualhost
for the project.
Using Xampp with windows
.