0

I am running on docker and nginx and Laravel log keeps giving redis not found error while running.

enter image description here

enter image description here

My Configurations:

  1. file .env:

    CACHE_DRIVER=redis

    SESSION_DRIVER=redis

    MEMCACHED_HOST=127.0.0.1

    REDIS_HOST=redis

    REDIS_PASSWORD=null

    REDIS_PORT=6379

  2. file database.php:

    'redis' => [

        'client' => env('REDIS_CLIENT', 'phpredis'),
    
        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
        ],
    
        'default' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_DB', '0'),
        ],
    
        'cache' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_CACHE_DB', '1'),
        ],
    ]
    

I also installed sudo apt-get install php8.0-redis but still not working.

There are a lot of people asking about this problem but I haven't found a good way to solve this problem. I don't know if there is any way you can make it work as it should or can you turn off redis?

  • 1
    I think you did install `redis` but never enabled it. Can you do `phpinfo()` and look for `Redis` and see if it exists in there and if it enabled? – matiaslauriti Apr 02 '22 at 03:06
  • I used `phpinfo()` to check and found that redis exists and is enabled and still gives the same error. Don't know if you have any other way to get rid of this error? – Bình Nguyễn Apr 02 '22 at 03:23

0 Answers0