How to fix “Connection to Redis failed” error in Magento 2

This is a temporary solution to fix “Connection to Redis failed” error in Magento 2

Try remove redis configuration from the development server

Go to app/etc/env.php

Comment the following code from app/etc/env.php

  'cache' => [
           'frontend' => [
            'default' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'database' => '0',
                    'port' => 'XXXX'
                ]
            ],
            'page_cache' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'port' => 'XXXX',
                    'database' => '1',
                    'compress_data' => '0'
                ]
            ]
        ]
    ],

Leave a Reply