😂如果你能看到,哪么恭喜你,你来对了地方,你百度了一圈,发现所有写的是memcached的文章,里面都是装的memcache,我怀疑他们根本分不清楚memcachememcached,所以我们得出一个结论,就是百度傻逼.


下载DLL文件

首先你要去https://github.com/lifenglsf/php_memcached_dll 下载最新的dll文件,别问为什么去这里,你以为我没去尝试官方的dll么?解压后得到如下文件.[特别注意,如果没其他需求,选择对应版本basic包中的文件即可]
然后选择你所需要的版本,如果你是非线程安全就选NTS如果是启用了线程安全就选TS,具体这个怎么看..还有到底是x86还是x64嘛..你新建一个info.php文件然后内容如下:

<?php
phpinfo();
?>

然后通过你的浏览器访问你的域名/info.php即可查看到你的信息,如下图:

安装

复制文件到指定目录,比如我的环境是x64nts以及php7.4,且我想用3.2.0版本,那么就是/3.2.0/basic/php7.4/nts_x64目中的DLL文件.具体如下

  1. 复制php_memcached.dll到你的php版本对应目录的ext文件夹下.
  2. 复制libmemcached.dll到你的php版本根目录下
  3. 打开你的php.ini文件,如果你是用的kangle.那么打开php-templete.ini,在最后面加上extension=php_memcached.dll
    如下:
[memcached]
extension=php_memcached.dll
  1. 重启web server,或者重启你的php.

成功提示

安装成功以后再次访问你的域名/info.php可以在其中看到Memcached已经出来了,如下图:

检测工具

你也可以使用这个这个小工具来检测你的安装是否有效,上传访问即可,如果是远程memcached服务端,注意修改里面的IP地址.虽然写的是memcache,但是同样适用于memcached
memcached检测工具

可能会遇到的问题

Windows系统下memcached请求和通讯是需要memcache的,也就是说.你还需要启用memcache哈哈,不过一般现在什么集成环境都已经默认启用了memcahe如果没启用,找到对应的php-templete.ini文件,找到;extension=memcache去掉前面的;,然后重启php,或者重启web server.如果你连memcahe扩展都没有,哪麻烦你再去百度一下吧,这个我就不发了.太简单了

顺便存几个CC防御页面的代码,来自ITZMX

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Cache-Control: no-cache,no-store
Recaptcha: Anti-CC

<html><body><script language="Javascript">window.location="{{url}}";</script><a href="{{url}}"><div class="notice">
<div class="title">You have verified successfully</div>
<div class="description">Please wait, you are being redirected …</div>
</div></a></body></html>

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Cache-Control: no-cache,no-store
Recaptcha: Anti-CC


<!DOCTYPE html>
<meta charset="utf-8">
<style>
body,h1,h2,h3,h4,p,form,ol,ul{margin:0;}
ol,ul{padding:0;}
body,textarea,input,option,button{font:1.5em "PT Serif",\5FAE\8EDF\6B63\9ED1\9AD4,\5FAE\8F6F\96C5\9ED1,\534E\6587\7EC6\9ED1,Georgia,Times,"Times New Roman",serif;color:#222;}
h1,h2,h3,h4{font-weight:300;}
textarea:focus,input:focus{outline:none;}
::selection{background:rgba(0,149,255,0.1);}
ul{list-style-type:none;}
a{color:#333;text-decoration:none;}
html{overflow:auto;overflow-y:scroll;}
img{border:0 none;width:55px;height:54px;}
.o{overflow:hidden;zoom:1;}
.l{float:left;}
.r{float:right;}

html{text-align:center;}
h1{font-size:3em;padding:1em 0;}
p{padding:10px 0;}
.footer{padding:3em;color:#999;}
</style>
<title>CDN 安全防护系统</title>
<script>
function addZero(str,lenght){
return (Array(lenght).join(0) + str).slice(-lenght); 
}
function goto()
{
s1=2268322/151;
s2=6585-151;s1=addZero(s1,5);s2=addZero(s2,5);se=s1+s2;
location.href="{{murl}}";}</script><h1>CDN 安全防护系统</h1><p>该网站可能遇到CC攻击,正在对您的身份进行鉴定,单击下方按钮跳转至该网站</p><p><input type="button" onclick="goto();" value="-> 继续访问 <-" /></p><div class="footer">&#169; CDN 安全防护系统</div>

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Cache-Control: no-cache,no-store
Recaptcha: Anti-CC

<!DOCTYPE html>

<meta charset="utf-8">
<style>
body,h1,h2,h3,h4,p,form,ol,ul{margin:0;}
ol,ul{padding:0;}
body,textarea,input,option,button{font:1.5em "PT Serif",\5FAE\8EDF\6B63\9ED1\9AD4,\5FAE\8F6F\96C5\9ED1,\534E\6587\7EC6\9ED1,Georgia,Times,"Times New Roman",serif;color:#222;}
h1,h2,h3,h4{font-weight:300;}
textarea:focus,input:focus{outline:none;}
::selection{background:rgba(0,149,255,0.1);}
ul{list-style-type:none;}
a{color:#333;text-decoration:none;}
html{overflow:auto;overflow-y:scroll;}
img{border:0 none;width:55px;height:54px;}
.o{overflow:hidden;zoom:1;}
.l{float:left;}
.r{float:right;}

html{text-align:center;}
h1{font-size:3em;padding:1em 0;}
p{padding:10px 0;}
.footer{padding:3em;color:#999;}
</style>

<title>CDN安全防护系统</title>
<script>
function addZero(str,lenght){
return (Array(lenght).join(0) + str).slice(-lenght); 
}
function goto()
{
s1=16319-813;
s2=15689274/813;s1=addZero(s1,5);s2=addZero(s2,5);se=s1+s2;
location.href="{{murl}}";}setTimeout("goto()",5000);</script><h1>CDN 安全防护系统</h1><p>该网站可能遇到CC攻击,正在对您的身份进行鉴定,请等候几秒钟</p><p><!--input type="button" onclick="goto();" value="-> 继续访问 <-" /--><img src="data:image/gif;base64,R0lGODlhNgA3APMAAP///wAAAHh4eBwcHA4ODtjY2FRUVNzc3MTExEhISIqKigAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQACgABACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuB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