window下安装php7的memcached扩展

https://stackoverflow.com/questions/34952502/memcache-for-php7-on-windows,

git下载地址:https://github.com/nono303/PHP7-memcache-dll

百度网盘链接:http://pan.baidu.com/s/1ge9MvEN 密码:zwoh



根据自己的php版本下载

下载解压后,

就到 php/ext 目录下 把 php_memcache.dll 放到里面

然后在 php 目录下的 php.ini 增加一段内容
extension=php_memcache.dll

加完之后,重启 apache或者nginx

然后 在php页面输出phpinfo();

检查 memcache 是否成功加载了。

如果成功加载了 ,就可以 在一个php页面做 memcache测试了

1
2
3
4
5
6
7
8
9
10
11
<?php
//phpinfo();
 
$memcache = new Memcache;
$memcache->connect( '127.0.0.1' ,11211) or die( 'shit' );
 
$memcache-> set ( 'key' , 'hello memcache!' );
 
$ out = $memcache-> get ( 'key' );
 
echo $ out ;

 

成功的话会输出

1
hello memcache!



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值