Method/Step
1. Use the Phpinfo () function to view PHP version information, which will determine the extension file version
2. According to the PHP version number, the compiler version number and CPU architecture,
Choose Php_redis-2.2.5-5.5-ts-vc11-x86.zip and Php_igbinary-1.2.1-5.5-ts-vc11-x86.zip
:
http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/
Http://windows.php.net/downloads/pecl/releases/igbinary/1.2.1/
3. After decompression, copy the Php_redis.dll and php_redis.pdb to the PHP ext directory
4. Modify the PHP.ini, (PS: This php.ini file is in the Apache directory) to include in the file:
; Php_redis
Extension=php_igbinary.dll
Extension=php_redis.dll
Note: Extension=php_igbinary.dll must be placed in front of extension=php_redis.dll, otherwise this extension will not take effect
5. After restarting Apache, use Phpinfo to see if the extension was installed successfully
6. Create a new test.php page
<?php $redis =new redis (); $redis->connect (' 192.168.1.11 ', 6379); $redis->auth (' 123456 '); $redis->set (' Test ', ' HelloWorld '); echo $redis->get (' test ');? >
Reference: http://jingyan.baidu.com/article/9989c74631873bf648ecfed4.html
Redis in PHP configuration under Windows