windows的php7安装memcache扩展

安装memcache:http://www.runoob.com/memcached/memcached-connection.html
1.4.4
c:memcachedmemcached.exe -d install
c:memcachedmemcached.exe -d start
c:memcachedmemcached.exe -d stop

1.4.5

schtasks /create /sc onstart /tn memcached /tr “‘c:memcachedmemcached.exe’ -m 512”
telnet HOST PORT
今天想在window下安装php7的memcache扩展,结果发现php_memcache.dll的官方编译出来的版本支持到PHP 5.6就停了,找了半天才在外国人的网站找到

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测试了

<?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;

成功的话会输出
---------------------
作者:天涯孤狼x
来源:CSDN
原文:https://blog.csdn.net/the_lone_wolfs/article/details/79099858
版权声明:本文为博主原创文章,转载请附上博文链接!

原文地址:https://www.cnblogs.com/w1618/p/10796377.html