❗️ 若電腦已採用 Docker 容器化環境,可不用安裝 Redis 服務。
安裝
方法有兩種:
- 指令安裝(推薦):
brew install redis - 步驟安裝(不推薦,步驟較複雜)
- 先挑想安裝的版本
- 下載檔案:
wget http://download.redis.io/releases/redis-6.2.4.tar.gz - 解開壓縮:
tar xzf redis-6.2.4.tar.gz - 進入資料夾:
cd redis-6.2.4 ./configuremakesudo make install
啟動 Redis
- 啟動 Server:
redis-server - 啟動 Client:
redis-cli
WEB 介面
- 使用 phpRedisAdmin - https://github.com/erikdubbelboer/phpRedisAdmin
- 在 Server 目錄下 clone 專案:
git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git - 進入專案:
cd phpRedisAdmin - 執行:
git clone https://github.com/nrk/predis.git vendor要注意是否有開啟 Redis Server
設定
- 打開終端機,進入專案:
cd phpRedisAdmin - 複製並重新命名 config.sample.inc.php:
cp includes/config.sample.inc.php includes/config.php - 修改檔案 config.php:
subl includes/config.php