skip to Main Content

I am using Laravel Version: 7.5 , PHP VERSION: 7.4.8, SERVER: APACHE (XAMPP), PACKAGE: Redis, OS: Windows 10.

I have install Redis in my system and I am able to run redis-server successfully but when I use this in Laravel for broadcasting it will throw error which is as follows "Please make sure the PHP Redis extension is installed and enabled".
Please find attached screenshot about error.

2

Answers


  1. Chosen as BEST ANSWER

    I have found the answer add the key in .env file which is as follows: REDIS_CLIENT=predis


  2. Have you installed redis?
    https://redis.io/download

    what are your environment variable settings? For Redis:

    BROADCAST_DRIVER=redis
    QUEUE_CONNECTION=redis
    QUEUE_DRIVER=redis
    REDIS_HOST=127.0.0.1
    REDIS_PASSWORD=secret
    REDIS_PORT=6379
    

    and are you using laravel echo server? what are your laravel-echo-server setting?

    {
    "authHost": "http://localhost",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "id",
            "key": "key"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
            "password" : "secret"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "secureOptions": 67108864,
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "subscribers": {
        "http": true,
        "redis": true
    },
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "http://localhost:80",
        "allowMethods": "GET, POST",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
    }
    

    have you started your echo-server and queue? Use the following

    php artisan queue:work
    laravel-echo-server start
    

    also install predis/predis

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search