您的位置:首页 > 数据库 > Redis

windows下安装redis 并扩展php redis

2018-01-30 16:31 567 查看
废话不多说  直接来步骤

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服务是否开启
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: