最新消息:觉得本站不错的话 记得收藏哦 博客内某些功能仅供测试 讨论群:135931704 快养不起小站了 各位有闲钱就打赏下把 My Email weicots#gmail.com Please replace # with @

win 10 安装redis 以及php 配置redis 链接

LINX ajiang-tuzi 5059浏览

Windows10 64位 下安装redis

下载:
1.下载redis的windows应用程序,支持32位和64位,根据实际情况下载

下载地址:https://github.com/dmajkic/redis/downloads

示例


C:\Users\jiang>wget https://github.com/downloads/dmajkic/redis/redis-2.4.5-win32-win64.zip  --no-check-certificate
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = E:\tools\GnuWin32/etc/wgetrc
--2016-10-25 21:57:47--  https://github.com/downloads/dmajkic/redis/redis-2.4.5-win32-win64.zip
正在解析主机 github.com... 192.30.253.113, 192.30.253.113, 192.30.253.112, ...
Connecting to github.com|192.30.253.113|:443... 已连接。
WARNING: cannot verify github.com's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA':
  Unable to locally verify the issuer's authority
........

2.将相应的程序copy到你所需要的目录中,在这里我使用的64位,放到你自己【要存放的目录】 我的是 E:\weicot\tools\redis
启动redis服务端:
打开一个cmd窗口,先切换到redis所放目录,运行 redis-server.exe

注意redis.conf为配置文件,主要配置了redis所使用的端口等信息(如果不写则默认redis.conf)

测试

注意:运行后会出现窗口 此窗口为redis服务端运行窗口,关闭后则redis关闭

1.启动redis客户端:另开一个cmd窗口,进入目录之后运行命令redis-cli.exe 然后就可以进行操作了
示例

C:\Users\jiang>E:\WET\Drive\redis\redis-cli.exe -h 127.0.0.1 -p 6379
redis 127.0.0.1:6379> set key weicot
OK
redis 127.0.0.1:6379> get key
"weicot"
redis 127.0.0.1:6379>

添加php redis扩展

下载
win下 php redis 下载地址

windows.php.net – /downloads/pecl/snaps/redis/2.2.5/


[To Parent Directory]

  7/1/2014  4:09 PM        <dir> logs
 2/14/2015  1:48 PM       275106 php_redis-2.2.5-5.3-nts-vc9-x86.zip
 2/14/2015  1:53 PM       277666 php_redis-2.2.5-5.3-ts-vc9-x86.zip
 2/14/2015  1:39 PM       276859 php_redis-2.2.5-5.4-nts-vc9-x86.zip
 2/14/2015  1:43 PM       281157 php_redis-2.2.5-5.4-ts-vc9-x86.zip
 2/14/2015  1:20 PM       298262 php_redis-2.2.5-5.5-nts-vc11-x64.zip
 2/14/2015  1:29 PM       278089 php_redis-2.2.5-5.5-nts-vc11-x86.zip
 2/14/2015  1:24 PM       300127 php_redis-2.2.5-5.5-ts-vc11-x64.zip
 2/14/2015  1:34 PM       280357 php_redis-2.2.5-5.5-ts-vc11-x86.zip
 2/14/2015  1:02 PM       300655 php_redis-2.2.5-5.6-nts-vc11-x64.zip
 2/14/2015  1:11 PM       278319 php_redis-2.2.5-5.6-nts-vc11-x86.zip
 2/14/2015  1:06 PM       303325 php_redis-2.2.5-5.6-ts-vc11-x64.zip
 2/14/2015  1:15 PM       281607 php_redis-2.2.5-5.6-ts-vc11-x86.zip

 

安装
1.添加phpredis扩展首先,查看所用php编译版本V6/V9 在phpinfo()中查看
2.下载扩展 地址:https://github.com/nicolasff/phpredis/downloads(注意所支持的php版本)
3.将下载的php_redis.dll放在php扩展目录中(ext),并修改配置文件php.ini(添加extension=php_redis.dll)

5.4 之后只用添加extension=php_redis.dll

4.重新启动服务,查看phpinfo(),下面表示成功;
示例

D:\HOME>wget http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/php_redis-2.2.5-5.5-ts-vc11-x86.zip
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = E:\tools\GnuWin32/etc/wgetrc
--2016-10-25 21:12:22--  http://windows.php.net/downloads/pecl/snaps/redis/2.2.5/php_redis-2.2.5-5.5-ts-vc11-x86.zip
正在解析主机 windows.php.net... 195.8.208.241, 195.8.208.241
Connecting to windows.php.net|195.8.208.241|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:280357 (274K) [application/x-zip-compressed]
Saving to: `php_redis-2.2.5-5.5-ts-vc11-x86.zip'

100%[==============================================================================================================================>] 280,357     26.1K/s   in 8.8s

2016-10-25 21:12:31 (31.0 KB/s) - `php_redis-2.2.5-5.5-ts-vc11-x86.zip' saved [280357/280357]


C:\Users\jiang>php -r"phpinfo();";
phpinfo()
PHP Version => 5.5.1
.....
har.require_hash => On => On

redis

Redis Support => enabled
Redis Version => 2.2.7
......
//php 测试代码
echo "<br />";
echo "<br />";
    $redis = new Redis();
    $redis->connect('127.0.0.1',6379);
    $redis->set('test','hello redis');
    echo $redis->get('test');

转载请注明:(●--●) Hello.My Weicot » win 10 安装redis 以及php 配置redis 链接

蜀ICP备15020253号-1