First, Redis application installation
1. Download Redis for Windows
The official website currently only provides the Linux version of the download, the official website now does not have the Windows package download address, can only download on Github.
IO/Download
Github download: github.com/MSOpenTech/…
2. Install Redis
Redis-x64-3.2.100, my computer is Windows Server 2008 64-bit, so download the 64-bit version, enter CMD in the run, and then point to the unzipped Redis directory.
(2) Start command
Redis-server redis.windows.conf, if the following figure is displayed, the startup is successful.
3. Set up the Redis service
(1) Although redis is started above, as long as the CMD window is closed, Redis will disappear. So make Redis a Windows service.
The Redis service is not used.
(2) Set the service command
redis-server –service-install redis.windows-service.conf –loglevel verbose
If no error is reported after entering the command, it indicates success. Refresh the service, and you will see an additional Redis service.
(3) Commonly used Redis service commands.
Uninstall service: redis-server –service-uninstall
Start the service: redis-server –service-start
Stop the service: redis-server –service-stop
4. Start the service
5. Test Redis
Redis was installed and tested successfully.
Second, PHP extension installation
1. Use the phpInfo () function to view PHP version information, which determines the extension file version
2. Based on PHP version number, compiler version number, and CPU architecture
Select php_redis-3.1.4-7.0-nts-vc14-x86.zip and php_igbinary-2.0.7-7.0-nts-vc14-x86.zip
Download address:
Windows.php.net/downloads/p…
Windows.php.net/downloads/p…
3. Copy php_redis. DLL and php_igbinar. DLL to the ext directory in PHP
4. Modify php.ini to add:
extension=php_igbinary.dll
extension=php_redis.dll
Note: Extension =php_igbinary. DLL must be placed before extension=php_redis.
5. Restart Apache and run phpInfo to check whether the extension is successfully installed.