hyperf 默认 demo 提示找不到 Redis,Redis 配置是对的,其它框架 Redis 使用正常。。。

<?php 
use Hyperf\Utils\ApplicationContext; 
$container = ApplicationContext::getContainer(); 
$redis = $container->get(\Redis::class); 
$result = $redis->keys('*');
[ERROR] Class 'Redis' not found[100] in /home/vagrant/code/hyperf/vendor/hyperf/redis/src/RedisConnection.php
[ERROR] #0 /home/vagrant/code/hyperf/vendor/hyperf/redis/src/RedisConnection.php(62): Hyperf\Redis\RedisConnection->reconnect()
REDIS_HOST=127.0.0.1
REDIS_AUTH=
REDIS_PORT=6379
REDIS_DB=0
讨论数量: 3

composer require hyperf/redis 有么

4年前 评论
calvinr (楼主) 4年前

缺少了 Redis 扩展

4年前 评论
huangzhhui (作者) 4年前
calvinr (楼主) 4年前
calvinr (楼主) 4年前

你好,请问你当时是怎么解决的?我也遇到同样问题了

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!