Install Redis for PHP 7.2 (Windows)

2020-07-08 15:50:00
Ley Boi
Original 28219
Summary : Redis is completely open source and free. It complies with the BSD and is a high-performance key-value database.

Install Redis for PHP 7.2 (Windows)

Introduction

Redis is completely open source and free. It complies with the BSD and is a high-performance key-value database.


Redis, as a key-value caching product, has the following three features,

  • Supports the persistence of data. It can save the data in memory on the disk, and it can be reused when it is restarted.
  • Not only does it support simple key-value type data, but also provides storage of data structures such as list, set, zset, and hash.
  • Support data backup in master-slave mode.

Installation Steps

1. Check phpinfo and download the right Redis extension.

PHP7.2 version here is x86, NTS, VC15. According to the PHP version information, download the right Redis extension.


2. Download Redis extension

Download URL https://windows.php.net/downloads/pecl/releases/redis/

Take Redis with PHPStudy as an example. 


Go to the installation directory ...\PHPTutorial\Redis and open the window here. Execute redis-server.exe redis.windows.conf. After starting Redis, check the Redis version, and download the extension according to the Redis version./p>

The Redis version here is 3.0.503, but 3.0.0 version is selected in the extension. The PHP version is 7.2, so the Redis 3.0 extension is not supported. Therefore, the Redis 3.1.4 version will be downloaded for it.

Download the extension, and unzip the extension package.

3. Configure PHP extension file

Copy  php_redis.dll and php_redis.pdb files to PHP extension file directory ...\PHPTutorial\php\php-7.2.1-nts\ext.


Edit the php.ini file and add extension=php_redis.dll to it.

Restart PHPstudy and check phpinfo again. An additional Redis extension information should be there.

Write a Comment
Comment will be posted after it is reviewed.