#### 1. redis 擴展下載 --- **redis 擴展下載地址** [https://windows.php.net/downloads/pecl/releases/redis](https://windows.php.net/downloads/pecl/releases/redis) **查看當(dāng)前PHP的四個信息** ![](https://img.itqaq.com/art/content/c3d4fa0025f7cb50011487107bddfce9.png) **鎖定適合當(dāng)前PHP的擴展** ![](https://img.itqaq.com/art/content/a4da9a65aade67efec336ab09d518d20.png) #### 2. 將 redis 擴展放入 PHP擴展目錄 --- **解壓壓縮包,復(fù)制 redis 擴展** ![](https://img.itqaq.com/art/content/e37eeb90bcdacebe88d4edbf3221a05c.png) **將擴展放在PHP的擴展目錄 (ext) 中** ![](https://img.itqaq.com/art/content/05833a17c9a86f26d51a7358c5cf6f88.png) **修改PHP配置文件,使其加載 redis 擴展** ``` extension=php_redis.dll ``` #### 3. phpinfo() 能看到 redis 代表安裝成功 --- **加載了 redis 擴展才能使用 Redis 類,否則將提示 Redis 類不存在** ```php $redis = new Redis; $redis = $redis->connect('127.0.0.1', 6379); ``` ![](https://img.itqaq.com/art/content/cef3c26c1c1d0009bdeb256be6973760.png)