Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

whitenazgul's avatar

AWS Elasticache cluster mode with phpredis gives RedisException MOVED

Hi, We am working on moving our laravel project to AWS fargate. We are also configuring AWS Elasticache Redis with cluster mode. When I visit my website it gives an error

RedisException
MOVED 1529 X.X.X.X:6379

I have followed the instruction as per the laravel Guide - Configuring Clusters

Env details

  • PHP 7.4.4
  • Laravel 6.X
  • Elasticache Redis cluster
    • (5.0.6) with 3 shares each running 3 nodes (1 primary and 2 replicas)
    • Encryption in-transit - No
    • Encryption at-rest - No
    • Redis Auth - No
  • Session Driver - Redis
  • Cache Driver - Redis
  • Queue Driver - Redis

My database.php file looks like this -

'redis' => [
        'client'  => 'phpredis',

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
        ],

        'clusters' => [
            'default' => [
                [
                    'host' => env('REDIS_HOST', '127.0.0.1'),
                    'password' => env('REDIS_PASSWORD', null),
                    'port' => env('REDIS_PORT', 6379),
                    'database' => 0,
                ],
            ],
        ],
    ],

For redis host I am using the configuration endpoint of the cluster which looks something like this - xxxxxxxxxx.xxxxxxxx.xxxxxxx.use1.cache.amazonaws.com

Any ideas what I am doing wrong?

Much Appreciated A

0 likes
2 replies
simonw's avatar

Hey,

Did you find a solution to this? I've seen several configurations that require the password field to be added to to options parameters, and a verify_peer field set to false specifically for Elasticache:

'options' => [
    'parameters' => [
        'password' => env('REDIS_PASSWORD', null),
        'scheme' => env('REDIS_SCHEME', 'tcp'),
    ],
    'ssl' => ['verify_peer' => false],
],

Did something like this work? If not, what did you do to fix it. I have the same problem even with these settings.

Please or to participate in this conversation.