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!
|