yii2的redis带验证密码的配置

yii2的redis扩展

在yii的config目录下,编辑web.php,在components中加上password配置项:


‘redis’ => [
‘class’ => ‘yii\redis\Connection’,
‘hostname’ => ‘localhost’,
‘port’ => 6379,
‘database’ => 0,
  ‘password’ => ‘123456’,
],

在使用时就不用手动去做auth验证了

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_509.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?