windows下安装redis 并扩展php redis

6 篇文章 0 订阅
2 篇文章 0 订阅

废话不多说  直接来步骤


1、下载windows版本的  下面是我自用的  

http://url.cn/5kGcteF       密码 :  0S3Xy2


2、下载php redis扩展文件, 注意:下面的是扩展对应的版本是php5.4nts,如果版本不同就自行百度吧

http://url.cn/55IAPcu     密码: CqpAT1


3、把下载的windows版的redis放到自定义的目录 ,打开cmd, 启动redis服务,

redis-server.exe redis.windows.conf


3.1其中可能会报错:如下 : 由于没有指定maxheap导致的,当然了不指定该参数不一定报错,但是出现上述原因,通常是这个原因导致的

The Windows version of Redis allocates a memory mapped heap forsharing with


the forked process used for persistenceoperations. In order to share this


memory, Windows allocates from the systempaging file a portion equal to the


size of the Redis heap. At this time thereis insufficient contiguous free


space available in the system paging filefor this operation (Windows error


0x5AF). To work around this you may eitherincrease the size of the system


paging file, or decrease the size of theRedis heap with the --maxheap flag.


Sometimes a reboot will defragment thesystem paging file sufficiently for


this operation to complete successfully.



Please see the documentation included withthe binary distributions for more


details on the --maxheap flag.


解决方法:redis-server.exe --maxheap 500m  


3.2:redis 开机自动启动服务 

开始-》运行-》regedit  打开注册表 

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 

在Run下 新建一个字符串值

名称是 scenewood   数据值:      "redis-server.ext的路径"  :例如: "I:\extend\redis\redis-server.exe"

如果是3.1的操作  这是的字符串值这样写 :    "I:\extend\redis\redis-server.exe" --maxheap 500m   就可以了


4:安装php redis扩展

将下载来的 php_redis.dll 和 php_igbinary.dll 放在 php的ext的目录下  


4.1:编辑php.ini 

extension=php_igbinary.dll
extension=php_redis.dll


4.2重启apache  就可以redis了   ,注意一点在php里使用redis ,要注意redis服务是否开启




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值