Environment: Windows7 x64 Apache2.4 PHP5.6 mysql5.5
Raw materials: Redis plug-in and Redis server software
: Redis plugin Http://windows.php.net/downloads/pecl/releases/redis/2.2.7/php_redis-2.2.7-5.6-ts-vc11-x64.zip
We can also download the corresponding PHP version of the Redis plugin according to our own needs.
First go to the PHP website
Www.php.net-> Select Downloads-> in the page that appears, select one of the Windows downloads-> appear in the page that you chose to make pecl for Windows block pecl Extensions
The new page that appears, select Download statistics-> on the page that appears to find Redis, and then click on the page that appears after clicking on the link, choose DLL link in the page that appears, select the corresponding version of the
Redis Extensions
After downloading, get a zip package, unzip it, and put it in. DLL files to the Ext folder under the PHP installation directory
Extension has been obtained, next we download Redis Server Software
: Https://github.com/dmajkic/redis/downloads
I just downloaded the 2.2.7 plugin, so the server I choose now must be greater than 2.2.7, but given the compatibility of the version, I used the 2.2.12 Version of the server
Get a ZIP package, unzip to get two versions of the Server software, I use x64, and change the folder name to Redis
Let the Redis server run, open the Windows CMD window, and switch to the Redis directory.
After the test is successful, we will link the PHP program
The first step is to add the extension of the module to the php.ini
Extension=php_igbinary.dll
Extension=php_redis.dll
Then save and restart the Apache server
Then write a test code test
<?php
$redis = new Redis ();
$redis->connect (' 127.0.0.1 ', 6379);
$redis->set (' string ', ' Hello Redis ');
echo $redis->get (' string ');
?>
If you want to test successfully, you must ensure that the command-line window running Redis is still open, that is, the Redis service is still running before it can be successfully tested or failed!
Installing Redis under Windows