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
F:\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
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)
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/>";p rint_r ($redis->mget ($array _get));
Installing and using Redis under Windows