php-redis 5.0.2-2
redis 5.0.5-1
I've starting to upgrade from 5.8 to Laravel 6.0. As recommended by the docs I've moved to phpredis
.
I already removed the Redis alias, but it keeps using the wrong driver (at least I think so):
'client' => env('REDIS_CLIENT', 'phpredis'),
If more info is needed, please let me know.
Sorry for the noise, it seems the php-redis
extension wasn't (correctly) enabled.
Hmm, that suggested fix by the error handler is incorrect. It should suggest to install the extension, always, from Laravel 6 onwards.
//cc @freekmurze
We'll update the solution for this in ignition 👍
How to solve this?
Always fire when Change Redis Facade to RedisManager in app.php
@asterism612 Verify the redis extension is installed correctly and listed using phpinfo()
(or any other CLI way).
@francoism90 I am facing same issue. Just installed php-redis
and pecl install redis
, but no success. Are you using Docker? Can you share your Dockerfile?
In my case, just noticed error is thrown randomly.
@robsontenorio Sorry, I'm not using Docker. Are you sure the extension has been enabled?
$ cat /etc/php/conf.d/redis.ini
extension=redis
Edit: I however agree with @mfn , also recommend using a package instead.
Just installed
php-redis
andpecl install redis
Btw, this reads confusing because it's meant to be the same thing. You probably meant sudo apt-get install php-redis
and when you also do pecl…
you _could_ end up with the same PHP extension twice on your system.
_Usually_ sudo apt-get install php-redis
also enables it. If not, sudo phpenmod redis
will do. It's implicitly does something similar to https://github.com/laravel/framework/issues/29955#issuecomment-549785611
Tread carefully as to not mix stuff here on your server!
By default In Laravel 6 'client' => env('REDIS_CLIENT', 'phpredis'), is not working but when i change this 'client' => env('REDIS_CLIENT', 'predis'),.Why this Problem Occurred If It elaborate then it will be helpful
This problem was related to a third party package. I am sorry.
By default In Laravel 6 'client' => env('REDIS_CLIENT', 'phpredis'), is not working but when i change this 'client' => env('REDIS_CLIENT', 'predis'),.Why this Problem Occurred If It elaborate then it will be helpful
Change "phpredis" to "predis" it work pefectly!
predis
This just saved me over 3 hours of work. Thank you @incepitkhoabui
'redis' => [
'cluster' => false,
'client' => env('REDIS_CLIENT', 'predis'),
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE', 0),
'password' => env('REDIS_PASSWORD', ''),
],
],
'redis' => [
'cluster' => false,
'client' => env('REDIS_CLIENT', 'predis'),
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE', 0),
'password' => env('REDIS_PASSWORD', ''),
],],
In which file?
'redis' => [
'cluster' => false,
'client' => env('REDIS_CLIENT', 'predis'),
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE', 0),
'password' => env('REDIS_PASSWORD', ''),
],],
In which file?
It's in: /config/database.php
You can simply add
REDIS_CLIENT=predis
to your .env
file
By default In Laravel 6 'client' => env('REDIS_CLIENT', 'phpredis'), is not working but when i change this 'client' => env('REDIS_CLIENT', 'predis'),.Why this Problem Occurred If It elaborate then it will be helpful
Change "phpredis" to "predis" it work pefectly!
Thats a workaround and only good for dev-enviroment. You should use the pecl package instead of predis
install by sudo apt-get install php-redis
modify php.ini of your fpm-version.
restart php service
rename Redis to RedisManager in app.php aliases
check that predis is removed in vendor an composer.json
modify env file or set correct client in database.php
clear conf cache , composer dump-autoload
Most helpful comment
Change "phpredis" to "predis" it work pefectly!