2.根据PHP版本号,编译器版本号和CPU架构,
选择php_redis-2.2.5-5.6-ts-vc11-x64.zip和php_igbinary-1.2.1-5.5-ts-vc11-x64.zip下载地址:
http://windows.php.net/downloads/pecl/releases/redis/2.2.7/
http://windows.php.net/downloads/pecl/releases/igbinary/2.0.1/
3.解压缩后,将php_redis.dll和php_igbinary.dll拷贝至php的ext目录下4.修改php.ini,在该文件中加入:
; php_redis
extension=php_igbinary.dll
extension=php_redis.dll
注意:extension=php_igbinary.dll一定要放在extension=php_redis.dll的前面,否则此扩展不会生效 5.重启Apache后,使用phpinfo查看扩展是否成功安装新建一个test.php页面
<?php$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello redis');
echo $redis->get('test');
?> hello redis 6. 要在Windows中使用redis需要下载Windows版的redis软件
7. 在windows中让redis开机自启动:
redis-server --service-install redis.windows-service.conf --loglevel verbose
来源:https://www.cnblogs.com/keta/p/8557512.html