There are two ways to build a Redis: 1 to build services on Windows, which is to install Redis on Windows. 2 redis application to build PHP
1. Install Redis on Windows
Download the Redis, copy to a directory, switch to the specified installation location on the command line, run Redis-server.exe redis.conf
Redis server has been installed successfully!
Remember: This command window cannot be closed, then start another command window again, switch to the Redis installation directory, run Redis-cli.exe-h 127.0.0.1-p 6379, where 127.0.0.1 is the local IP, 6379 is the default port on the Redis server. Then perform the appropriate tests.
2. Building a Redis application for PHP
Put the downloaded Php_redis.dll module in the PHP installation directory/ext/, in php.ini; Extension=php_redis.dll before Extension=php_bz2.dll
Test code
1 <? PHP 2 $redis New Redis (); 3 $redis->connect (' 127.0.0.1 ', 6379); 4 $redis->set (' Test ', ' Hello Redis '); 5 Echo $redis->get (' Test '); 6 ?>
Note: The DOS command window that launches Redis cannot be turned off, otherwise clients such as PHP cannot use Redis.
PHP Builds redis on window