Reputation: 1609
I just setup GeneaLabs/laravel-model-caching packages. When running serve i got redis class missing. Then i run
composer required predis/predis
After that I got this error
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]
and i got this error. Still working but I have not made any progress yet. Any idea?
PS: i am working localhost with mysql. Not homestead.
Upvotes: 2
Views: 12678
Reputation: 2667
install latest version of redis from This link is in GateHub
then go to the .env file and change the CACHE_DRIVER to redis
CACHE_DRIVER=redis
then go to the path config/database.php
and change the REDIS_CLIENT
from phpredis
to predis
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
],
and clear config with this command : php artisan config:clear
Upvotes: 0
Reputation: 819
Install Redis.
https://redis.io/download or if the os is windows then https://github.com/MicrosoftArchive/redis/releases
Run Redis.
$ src/redis-server or in windows then run redis-server.exe
Set the .env variables
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Add redist code to database.php
'redis' => [
'client' => 'predis', 'default' => [ 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), 'database' => 0, ],
],
Upvotes: 5