One, install Redis
1. Download the installation package
https://github.com/MSOpenTech/redis/releases/
Select a latest version Redis-2.8.19.zip
2. Extract to a specific directory
D:\redis-2.8.19
3. In the cmd window, go to the specified directory and start the service using the following command
Redis-server.exe redis.windows.conf
4. Double hit Open redis-cli.exe, if not error, even on the local server, test the Set,get command
127.0.0.1:6379> Set Key test
Ok
127.0.0.1:6379> Get key
"Test"
Second, install the Redis extension
1. Download the installation package, note the version used
Https://github.com/phpredis/phpredis/downloads
If you don't have the version you want, you can go to this link to see
http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/
2. Put the downloaded Php_igbinary.dll,php_redis.dll in the PHP extension directory (EXT)
3. Modify the configuration file php.ini (add Extension=php_igbinary.dll,Extension=php_redis.dll, and Extension=php_igbinary.dll PHP will report an error before you put it in Extension=php_redis.dll )
4. Restart the service, view Phpinfo () to find out if the Redis extension is successfully installed
Third, use the PHP connection test
$redis = new Redis();$redis->connect("127.0.0.1","6379"); $redis->set("say","Hello World");echo "<br/>".$redis->get("say"); $array = array(‘first_key‘=>‘first_val‘,‘second_key‘=>‘second_val‘,‘third_key‘=>‘third_val‘);$array_get= array(‘first_key‘,‘second_key‘,‘third_key‘);$redis->mset($array);echo "<br/>";print_r($redis->mget($array_get));
Installing and using Redis under Windows