predis ERR unknown command 'EVAL'

laravel版本:5.5.36
redis版本:3.06
在laravel项目中引用predis的时候,我在本地windows环境没有问题,但是到生产环境就有问题了。
我的代码如下:

    public function getPhoneCode()
    {
        Cache::rememberForever('getAllPhoneCodeMultiViewData', function () {
            return Area::where('status', 1)
                ->whereIn('level', [2, 3])
                ->orderBy('pinyin', 'asc')
                ->get(['id', 'english_name', 'chinese_name', 'iso2', 'area_phone_number', 'pinyin']);
        });

        return Cache::get('getAllPhoneCodeMultiViewData');
    }

缓存配置使用的是redis,生产环境报错如下:
exception=PredisResponseServerException
file=/bcc/production/BCCKidV1.0/vendor/predis/predis/src/Client.php
line=370
message=ERR unknown command 'EVAL'

class : "PredisClient"
file : "/bcc/production/BCCKidV1.0/vendor/predis/predis/src/Client.php"
function : "onErrorResponse"
line : 335
type : "->"

请问这是怎么回事?我的redis是在2.6已上

阅读 6.7k
3 个回答

redis 版本低的问题,没有eval 命令
详见

我也出现了这个问题,是redis集群的原因,
1、config/queue.php文件connections.redis.queue 改为'{default}'
2、队列也加上{}
php artisan queue:listen --queue={high},{default},{low} --sleep=3 --tries=3 --timeout=0

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题