redis外部连接

更改redis.conf 文件

bind 127.0.0.1
protected-mode yes
#requirepass 123456

更改为

# bind 127.0.0.1
protected-mode no

requirepass 123456


yii配置
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => '127.0.0.1',
'port' => 6379,
'database' => 1,
//'unixSocket' => '/var/run/redis/redis.sock',
'password' => 'rds423fsadD',
// 'unixsocket' => '/var/run/redis/redis.sock',
// 'unixSocket' => '/tmp/redis.sock',
],

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2022-01-23
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2021-04-22
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案