framework: Class 'Redis' not found
- Laravel Version: 6.0.3
- PHP Version: 7.3.9
- Database Driver & Version:
php-redis 5.0.2-2
redis 5.0.5-1
Description:
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):
Steps To Reproduce:
- Upgrade to 6.0
- Removed predis
- Update all configs, including
'client' => env('REDIS_CLIENT', 'phpredis'),
If more info is needed, please let me know.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 20 (4 by maintainers)
Change “phpredis” to “predis” it work pefectly!
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
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 dopecl…
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-549785611Tread carefully as to not mix stuff here on your server!
It’s in:
/config/database.php
You can simply add
REDIS_CLIENT=predis
to your.env
fileSorry for the noise, it seems the
php-redis
extension wasn’t (correctly) enabled.We’ll update the solution for this in ignition 👍