laradock环境搭建好,laravel项目env文件redis配置:

```env

REDIS_HOST=redis

REDIS_PORT=6379

REDIS_DATABASE=0

```

错误提示

```

`SELECT` failed: ERR invalid DB index [tcp://redis:6379]

```

原因&解决:

ERR invalid DB index可判断redis数据库index不可用,配置文件里配置为0,改为其它即可(1-15之间数字或者用字符串'0')。

REDIS_DATABASE = 0 gets turned into "database":"" and gives ERR invalid DB index 

REDIS_DATABASE = "0" results in "database":"0" and works