Install Redis for PHP 7.2 (Windows)

原创
2020-07-11 13:26:21
Ley Boi
675
摘要:Redis is completely open source and free. It complies with the BSD and is a high-performance key-value database.

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.

发表评论
评论通过审核后显示。