From d0b7807a3693de0653e9ec3909f4bb0ee24aac39 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Fri, 24 May 2024 20:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E9=85=8D=E7=BD=AEredis=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 6 ++++++ config/web.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index f2693f9..81a046c 100644 --- a/.env.example +++ b/.env.example @@ -18,6 +18,12 @@ DB_USERNAME= # 数据库密码[string] DB_PASSWORD= +# Redis +# Redis地址[string] +RD_HOST= +# Redis端口[int] +RD_PORT= + # 验证码配置 # 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile,None] VERIFY_PROVIDER= diff --git a/config/web.php b/config/web.php index 8fa242a..d268cf7 100644 --- a/config/web.php +++ b/config/web.php @@ -61,8 +61,8 @@ $config = [ ], 'redis' => [ 'class' => 'yii\redis\Connection', - 'hostname' => 'localhost', - 'port' => 6379, + 'hostname' => $_ENV['RD_HOST'], + 'port' => $_ENV['RD_PORT'], 'database' => 0, ], 'db' => $db,