欢迎访问!

Office学习网

您现在的位置是:主页 > 网络技术

网络技术

Laravel predis, Redis Cloud got error; `SELECT` failed: ERR

发布时间:2026-09-09网络技术评论
I trying to cache all users into Redis. It worked well in local Redis when I try to set up with Redis cloud not worked anymore. For setup, I followed t

40);return response()-json($data, 200);}$data = User::all();Cache::put('users', $data, I followed these steps; I subscribe Redis Cloud for a 30MB free subscription. added predis package to laravel project; composer require predis/predis after all, edited .env file according to the public endpoint and default user password ; .env ; REDIS_CLIENT=predisREDIS_HOST=redis-16388.c250.eu-central-1-1.ec2.cloud.redislabs.comREDIS_PASSWORD=yH********************REDIS_PORT=16388 Code ; public function show(){if (Cache::has('users')) {$data = Cache::get('users');return response()-json($data, I trying to cache all users into Redis. It worked well in local Redis when I try to set up with Redis cloud not worked anymore. For setup, 200);} Error; Predis\Connection\ConnectionException: SELECT failed: ERR DB index is out of range [tcp://redis-16388.c250.eu-central-1-1.ec2.cloud.redislabs.com:16388] in file C:\xampp\htdocs\redisPro\vendor\predis\predis\src\Connection\AbstractConnection.php on line 155 ,。

广告位

热心评论

评论列表