<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';color:#E56600;">OCS是阿里云的开放缓存服务,你可以理解为(内网的)远程memcached服务,免费提供128M的规格</span> 

</p>
<p>

<span style="color:#E56600;font-size:14px;">PS:请确保你的主机环境已经安装了memcached服务和memcached扩展,以下方法为在windows下测试,需要的朋友请自行测试</span> 

</p>
<p>

<span style="color:#E56600;font-size:14px;"><br />

</span>
</p>
<h2>

<span style="font-size:18px;font-family:'Microsoft YaHei';">一.准备工作:登陆阿里云控制台,开通128M规格的免费OCS,并设置为免密码验证模式,并绑定主机</span> 

</h2>
<p>

<span style="font-family:'Microsoft YaHei';font-size:14px;line-height:1.5;">如图:</span> 

</p>
<p>

<a href="http://oss.hivps.cn/2015/01/1.png"><img src="http://oss.hivps.cn/2015/01/1.png" alt="1" width="1007" height="432" class="alignnone size-full wp-image-126" /></a> 

</p>
<p>

<br />

</p>
<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';color:#E56600;">并在OCS中查询OCS的内网地址备用:</span> 

</p>
<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';">如图:</span> 

</p>
<p>

<a href="http://oss.hivps.cn/2015/01/2.jpg"><img src="http://oss.hivps.cn/2015/01/2.jpg" alt="2" width="693" height="444" class="alignnone size-full wp-image-127" /></a><span style="font-size:14px;font-family:'Microsoft YaHei';"></span> 

</p>
<p>

<br />

</p>
<h2>

<span style="font-size:18px;font-family:'Microsoft YaHei';">二.wordpress 启用 memcached服务</span> 

</h2>
<p>

<br />

</p>
<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';">下载memcached插件:&nbsp;</span><a href="http://oss.hivps.cn/2015/01/object-cache.rar"><span style="font-size:14px;font-family:'Microsoft YaHei';">object-cache</span></a> 

</p>
<p>

<br />

</p>
<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';">解压后编辑&nbsp;</span><span style="font-size:14px;font-family:'Microsoft YaHei';">object-cache.php 文件</span> 

</p>
<p>

<span style="font-size:14px;font-family:'Microsoft YaHei';">搜索:</span> 

</p>
<p>

<br />

</p>

$buckets = array('127.0.0.1:11211');
<span style="font-size:14px;font-family:'Microsoft YaHei';">将127.0.0.1修改为你的OCS的内网地址</span> <p>
</p> <p>
</p> <p> <span style="font-size:14px;font-family:'Microsoft YaHei';">完成后上传</span><span style="font-size:14px;font-family:'Microsoft YaHei';">object-cache.php 文件</span><span style="font-size:14px;font-family:'Microsoft YaHei';">到wordpress目录下的</span><span style="font-size:14px;font-family:'Microsoft YaHei';">/wp-content 文件夹即可</span> </p> <p>
</p> <p> <span style="font-size:14px;font-family:'Microsoft YaHei';">成功后访问wp可早OCS控制台查看到命中</span> </p>
Last modification:December 13th, 2017 at 11:43 pm