<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sat, 24 Oct 2020 15:42:21 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] “不需要升级，您的WordPress数据库已经是最新的了！”导致进不了WordPress管理后台的问题</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%b8%8d%e9%9c%80%e8%a6%81%e5%8d%87%e7%ba%a7%ef%bc%8c%e6%82%a8%e7%9a%84wordpress%e6%95%b0%e6%8d%ae%e5%ba%93%e5%b7%b2%e7%bb%8f%e6%98%af%e6%9c%80%e6%96%b0%e7%9a%84/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%b8%8d%e9%9c%80%e8%a6%81%e5%8d%87%e7%ba%a7%ef%bc%8c%e6%82%a8%e7%9a%84wordpress%e6%95%b0%e6%8d%ae%e5%ba%93%e5%b7%b2%e7%bb%8f%e6%98%af%e6%9c%80%e6%96%b0%e7%9a%84/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 15 Apr 2014 15:44:50 +0000</pubDate>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[object-cache]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[不需要升级]]></category>
		<category><![CDATA[您的WordPress数据库已经是最新的了]]></category>
		<category><![CDATA[管理后台]]></category>
		<category><![CDATA[缓存]]></category>
		<category><![CDATA[进不了]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=8115</guid>

					<description><![CDATA[<p>
今天突然发现，进不去WordPress后台管理页面了，登录之后，屏幕上就两句话：</p>
<blockquote>
<div>
		不需要升级</div>
<div>
		您的WordPress数据库已经是最新的了！</div>
</blockquote>
<div>
	由于我今天没有升级过WordPress，也没做什么后台设置更改，并且我从来没见过这个提示，所以刹那间心一凉，心想我的WordPress数据库不是出什么问题了吧？<br />
	于是问Google，查到这个问题是由于使用了object-cache缓存插件导致的问题，于是解决了，如下。<br />
	<span id="more-8115"></span><br />
	<span style="background-color:#00ff00;">『1』</span>登录Linux terminal，禁用object-cache缓存插件<br />
	这里假设你使用的是VPS，所以让你登录Linux terminal，进入WordPress的安装目录下的&#160;<span style="color:#0000ff;">wp-content</span> 子目录下：
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
mv object-cache.php object-cache.php.bak
</pre>
</div>
<p>重命名一下，你就会发现，WordPress的管理后台已经可以进去了！但是这样object-cache就是无效的，如何让它继续用起来？据我实验，如果你直接把上面重命名过的文件恢复原来的文件名，WordPress的管理后台又不能登录了，还是如标题所述的错误提示，于是要继续下面的操作。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『2』</span>flush memcache<br />
我曾经写过一篇关于WordPress下配置memcached的<a href="http://www.codelast.com/?p=5658" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">文章</span></a>，如其中所述，你可以在WordPress后台找到memcached的管理界面，在里面有一个&#8220;<span style="color:#0000ff;">Flush Memcache</span>&#8221;的按钮，操作之后，再到<span style="color:#0000ff;"> wp-content</span> 子目录下恢复刚才重命名的文件：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
mv object-cache.php.bak object-cache.php
</pre>
<p>此时再登录WordPress管理界面，一切正常了，瞬间感觉世界很美好。</p>
<p style="font-size: 16px; margin: 5px 0px; clear: both; font-family: sans-serif;">
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%b8%8d%e9%9c%80%e8%a6%81%e5%8d%87%e7%ba%a7%ef%bc%8c%e6%82%a8%e7%9a%84wordpress%e6%95%b0%e6%8d%ae%e5%ba%93%e5%b7%b2%e7%bb%8f%e6%98%af%e6%9c%80%e6%96%b0%e7%9a%84/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
今天突然发现，进不去WordPress后台管理页面了，登录之后，屏幕上就两句话：</p>
<blockquote>
<div>
		不需要升级</div>
<div>
		您的WordPress数据库已经是最新的了！</div>
</blockquote>
<div>
	由于我今天没有升级过WordPress，也没做什么后台设置更改，并且我从来没见过这个提示，所以刹那间心一凉，心想我的WordPress数据库不是出什么问题了吧？<br />
	于是问Google，查到这个问题是由于使用了object-cache缓存插件导致的问题，于是解决了，如下。<br />
	<span id="more-8115"></span><br />
	<span style="background-color:#00ff00;">『1』</span>登录Linux terminal，禁用object-cache缓存插件<br />
	这里假设你使用的是VPS，所以让你登录Linux terminal，进入WordPress的安装目录下的&nbsp;<span style="color:#0000ff;">wp-content</span> 子目录下：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
mv object-cache.php object-cache.php.bak
</pre>
</div>
<p>重命名一下，你就会发现，WordPress的管理后台已经可以进去了！但是这样object-cache就是无效的，如何让它继续用起来？据我实验，如果你直接把上面重命名过的文件恢复原来的文件名，WordPress的管理后台又不能登录了，还是如标题所述的错误提示，于是要继续下面的操作。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">『2』</span>flush memcache<br />
我曾经写过一篇关于WordPress下配置memcached的<a href="http://www.codelast.com/?p=5658" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">文章</span></a>，如其中所述，你可以在WordPress后台找到memcached的管理界面，在里面有一个&ldquo;<span style="color:#0000ff;">Flush Memcache</span>&rdquo;的按钮，操作之后，再到<span style="color:#0000ff;"> wp-content</span> 子目录下恢复刚才重命名的文件：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
mv object-cache.php.bak object-cache.php
</pre>
<p>此时再登录WordPress管理界面，一切正常了，瞬间感觉世界很美好。</p>
<p style="font-size: 16px; margin: 5px 0px; clear: both; font-family: sans-serif;">
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%b8%8d%e9%9c%80%e8%a6%81%e5%8d%87%e7%ba%a7%ef%bc%8c%e6%82%a8%e7%9a%84wordpress%e6%95%b0%e6%8d%ae%e5%ba%93%e5%b7%b2%e7%bb%8f%e6%98%af%e6%9c%80%e6%96%b0%e7%9a%84/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]用LaTeX for WordPress插件在WordPress中写数学公式</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e7%94%a8latex-for-wordpress%e6%8f%92%e4%bb%b6%e5%9c%a8wordpress%e4%b8%ad%e5%86%99%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e7%94%a8latex-for-wordpress%e6%8f%92%e4%bb%b6%e5%9c%a8wordpress%e4%b8%ad%e5%86%99%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 10 Jul 2013 12:58:59 +0000</pubDate>
				<category><![CDATA[Math]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=6199</guid>

					<description><![CDATA[<p>
WordPress是地球上使用最广泛的网站建立工具(或内容管理系统，CMS，Content Management System)，如果你想建一个自己的个人网站，用WordPress非常方便。​<br />
在WordPress中写数学公式有N种方法，以前我一直是用MathType写好公式后，屏幕截图，上传图片到WordPress服务器，然后在文章中引用该图片。这样做的好处就是兼容性好，无论在任何软件（例如RSS阅读器）中都可以正确显示，任何复杂的内容都可以在公式中完美显示（包括中文），还可以给公式加版权水印；当然坏处也非常明显：整个操作过程超级麻烦（尤其是要修改公式的时候）。<br />
<span id="more-6199"></span><br />
现在有一种更为简单的办法，虽然在某些时候显示效果不那么完美，但是大多数都是没问题的，那就是：使用WordPress的<a href="http://www.latex-project.org/" rel="noopener noreferrer" target="_blank">LaTex</a>插件<span style="color:#0000ff;">LaTeX for WordPress</span>（直接在WordPress后台的插件安装中搜索即可找到），可以直接在WordPress中用LaTex语法书写数学公式，当一个访客打开此文章页面时，它会自动地调用<a href="http://www.mathjax.org/" rel="noopener noreferrer" target="_blank">MathJax</a>的服务将页面中的LaTex代码渲染为数学公式。<br />
如果我们要修改文章中的公式，直接修改LaTex就可以了，保存文章之后，剩下的全都不需要我们管。</p>
<p><span style="background-color:#00ff00;">【1】</span>安装<span style="color: rgb(0, 0, 255);">LaTeX for WordPress</span>插件<br />
不用说了，直接在WordPress后台插件安装中心安装。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">【2】</span>写LaTex数学公式<br />
有人说，我不会LaTex语法怎么办？好吧，和我一样，惭愧惭愧。但是有一个折衷的办法：利用图形化的工具先输入好数学公式，然后再转换成LaTex。有什么图形化的工具可以实现这一点呢？太多了。下面举两个例子。<br />
<span style="background-color:#dda0dd;">①</span>在线LaTex公式编辑器<br />
<a href="http://www.codecogs.com/latex/eqneditor.php" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">编辑器1</span></a>，<a href="http://www.sciweavers.org/free-online-latex-equation-editor" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">编辑器2</span></a>，<span style="background-color: rgb(255, 160, 122);"><a href="http://arachnoid.com/latex/" rel="noopener noreferrer" target="_blank">编辑器3</a></span>。这些编辑器对不熟悉LaTex的人还是有障碍的，具体自己体会吧。<br />
<span style="background-color:#dda0dd;">②</span>桌面工具，如MathType<br />
先在MathType软件中以图形化方式输入好数学公式，然后Ctrl+A全选你输入的公式，Ctrl+C复制公式，到纯文本编辑器（例如Notepad++）中一粘贴，就可以得到公式的LaTex&#8220;翻译&#8221;了。<br />
&#8212;&#8212;这是怎么做到的？只要对MathType稍加设置即可实现。点击&#8220;选项&#8221;&#8594;&#8220;剪切和复制选项&#8221;，在打开的对话框中，像下面那样设置：</p>
<div style="text-align: center;">
	<img decoding="async" alt="MathType setting" src="http://www.codelast.com/wp-content/uploads/ckfinder/images/mathtype_setting_convert.png" style="width: 285px; height: 255px;" /></div>
<p>然后就可以实现上面的复制粘贴效果了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e7%94%a8latex-for-wordpress%e6%8f%92%e4%bb%b6%e5%9c%a8wordpress%e4%b8%ad%e5%86%99%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
WordPress是地球上使用最广泛的网站建立工具(或内容管理系统，CMS，Content Management System)，如果你想建一个自己的个人网站，用WordPress非常方便。​<br />
在WordPress中写数学公式有N种方法，以前我一直是用MathType写好公式后，屏幕截图，上传图片到WordPress服务器，然后在文章中引用该图片。这样做的好处就是兼容性好，无论在任何软件（例如RSS阅读器）中都可以正确显示，任何复杂的内容都可以在公式中完美显示（包括中文），还可以给公式加版权水印；当然坏处也非常明显：整个操作过程超级麻烦（尤其是要修改公式的时候）。<br />
<span id="more-6199"></span><br />
现在有一种更为简单的办法，虽然在某些时候显示效果不那么完美，但是大多数都是没问题的，那就是：使用WordPress的<a href="http://www.latex-project.org/" rel="noopener noreferrer" target="_blank">LaTex</a>插件<span style="color:#0000ff;">LaTeX for WordPress</span>（直接在WordPress后台的插件安装中搜索即可找到），可以直接在WordPress中用LaTex语法书写数学公式，当一个访客打开此文章页面时，它会自动地调用<a href="http://www.mathjax.org/" rel="noopener noreferrer" target="_blank">MathJax</a>的服务将页面中的LaTex代码渲染为数学公式。<br />
如果我们要修改文章中的公式，直接修改LaTex就可以了，保存文章之后，剩下的全都不需要我们管。</p>
<p><span style="background-color:#00ff00;">【1】</span>安装<span style="color: rgb(0, 0, 255);">LaTeX for WordPress</span>插件<br />
不用说了，直接在WordPress后台插件安装中心安装。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">【2】</span>写LaTex数学公式<br />
有人说，我不会LaTex语法怎么办？好吧，和我一样，惭愧惭愧。但是有一个折衷的办法：利用图形化的工具先输入好数学公式，然后再转换成LaTex。有什么图形化的工具可以实现这一点呢？太多了。下面举两个例子。<br />
<span style="background-color:#dda0dd;">①</span>在线LaTex公式编辑器<br />
<a href="http://www.codecogs.com/latex/eqneditor.php" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">编辑器1</span></a>，<a href="http://www.sciweavers.org/free-online-latex-equation-editor" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">编辑器2</span></a>，<span style="background-color: rgb(255, 160, 122);"><a href="http://arachnoid.com/latex/" rel="noopener noreferrer" target="_blank">编辑器3</a></span>。这些编辑器对不熟悉LaTex的人还是有障碍的，具体自己体会吧。<br />
<span style="background-color:#dda0dd;">②</span>桌面工具，如MathType<br />
先在MathType软件中以图形化方式输入好数学公式，然后Ctrl+A全选你输入的公式，Ctrl+C复制公式，到纯文本编辑器（例如Notepad++）中一粘贴，就可以得到公式的LaTex&ldquo;翻译&rdquo;了。<br />
&mdash;&mdash;这是怎么做到的？只要对MathType稍加设置即可实现。点击&ldquo;选项&rdquo;&rarr;&ldquo;剪切和复制选项&rdquo;，在打开的对话框中，像下面那样设置：</p>
<div style="text-align: center;">
	<img decoding="async" alt="MathType setting" src="http://www.codelast.com/wp-content/uploads/ckfinder/images/mathtype_setting_convert.png" style="width: 285px; height: 255px;" /></div>
<p>然后就可以实现上面的复制粘贴效果了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">【3】</span>LaTex在WordPress文章中的嵌套与换行居中模式<br />
你会发现，从MathType中复制到文本编辑器里的LaTex公式，填到WordPress的文章里时，每一个公式都会占用独立的一行，并且公式是居中的，这样绝对不能接受，例如下面这个效果&mdash;&mdash;已知函数 <p style='text-align:center;'><span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_ff27977c194408e6ad56689f4bdc316b.gif' style='vertical-align: middle; border: none;' class='tex' alt="f(x) = 3x + a" /></span><script type='math/tex;  mode=display'>f(x) = 3x + a</script></p>，求&nbsp;<p style='text-align:center;'><span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_d37ffc54b67ce8de1f01efb1f2e33689.gif' style='vertical-align: middle; border: none;' class='tex' alt="x = 1" /></span><script type='math/tex;  mode=display'>x = 1</script></p> 时的函数值。</p>
<p>汉字和公式被分成那么多行，这样多难看啊，解决办法就是：把复制出来的LaTex公式中的最外面的中括号替换为小括号。<br />
然后我们再重新看看上面的数学陈述的效果&mdash;&mdash;已知函数  <span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_ff27977c194408e6ad56689f4bdc316b.gif' style='vertical-align: middle; border: none; padding-bottom:2px;' class='tex' alt="f(x) = 3x + a" /></span><script type='math/tex'>f(x) = 3x + a</script> ，求&nbsp; <span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_d37ffc54b67ce8de1f01efb1f2e33689.gif' style='vertical-align: middle; border: none; padding-bottom:2px;' class='tex' alt="x = 1" /></span><script type='math/tex'>x = 1</script>  时的函数值。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
为什么会这样？这是因为在LaTex语法中，\ ( \ )表示inline, \ [ \ ] 表示换行居中（&rarr;我特意在这些符号之间都多加了一个空格以避免它们显示为数学公式）。</p>
<p><span style="background-color:#00ff00;">【4】</span>配置自己的MathJax服务<br />
前面说了，<span style="color: rgb(0, 0, 255);">LaTeX for WordPress</span>插件会默认使用MathJax提供的服务来渲染公式，如果MathJax服务不可用，或者被屏蔽了，那么此插件就会失效，为此，我们可以在自己的服务器上安装MathJax，使用自己的服务。方法可参考MathJax官方的<a href="http://docs.mathjax.org/en/v1.1-latest/installation.html" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇文章</span></a>，但我觉得此文章废话太多，核心的东西归纳为以下几步：<br />
<span style="background-color:#dda0dd;">①</span>在你的服务器上checkout出MathJax的源码，例如用git：</p>
<blockquote>
<p>
		git clone git://github.com/mathjax/MathJax.git MathJax</p>
</blockquote>
<p>当然，或者你用svn也可以：</p>
<blockquote>
<p>
		svn checkout http://svn.github.com/mathjax/MathJax.git MathJax</p>
</blockquote>
<p><span style="background-color:#dda0dd;">②</span>将checkout得到的整个目录拷贝到WordPress的&ldquo;wp-content&rdquo;目录下，这就是所谓的MaxJax安装：</p>
<blockquote>
<div>
		rm -rf MathJax/.git*</div>
<div>
		cp -r MathJax/ /xxx/wp-content/</div>
</blockquote>
<p>第一句是将checkout下来的版本控制相关的文件删除，否则它们占用太多的磁盘空间，没有意义。<br />
<span style="background-color:#dda0dd;">③</span>为MathJax目录以及MathJax/下的添加可执行权限<br />
<span style="background-color:#dda0dd;">④</span>测试MathJax是否能正常工作。根据我前面的安装路径，我的测试路径为：http://www.codelast.com/wp-content/MathJax/test/ ，如果你在页面中看到提示说working了，那么就OK了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="background-color:#dda0dd;">⑤</span>修改LaTeX for WordPress插件的设置，让它使用你刚安装的MathJax服务。在WordPress后台的&ldquo;设置&rdquo;&rarr;&ldquo;LaTex&rdquo;中，将&ldquo;<span style="color:#0000ff;">MathJax Server</span>&rdquo;选项选中&ldquo;<span style="color:#0000ff;">Custom Service</span>&rdquo;，填入类似于下面的字符串：</p>
<blockquote>
<p>
		/wp-content/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML</p>
</blockquote>
<p>注意这还是与你上面的安装路径相关的，如果你不是安装在这个相对路径下，需要做相应的修改。</p>
<p><span style="color:#ff0000;">NOTE</span>：使用自己的MathJax服务也是有隐患的&mdash;&mdash;如果你的MathJax版本一直没有更新，而你使用的浏览器渲染LaTex公式的行为有变化，那么就有可能导致你的网站上显示公式不正常。例如，我就遇到过一次：Chrome升级之后，每一个数学公式后面都有一个小竖线（trailing vertical line），和<a href="http://stackoverflow.com/questions/34277967/chrome-rendering-mathjax-equations-with-a-trailing-vertical-line" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇</span></a>文章里描述的一样，看上去非常恶心+难受。这正是由于我使用了自己服务器上的MathJax服务，并且它从安装之后就一直没有更新过的原因&mdash;&mdash;版本太旧了，兼容不了新版的Chrome。后来我只是在WordPress的后台&ldquo;设置&rdquo;&rarr;&ldquo;LaTex&rdquo;中，将&ldquo;MathJax Server&rdquo;选项改为&ldquo;MathJax CDN&rdquo;，就解决了问题，因为这会让我使用最新的MathJax服务。</p>
<p><span style="color:#ff0000;">2017.06.12更新</span>：从2017.04.30开始，MathJax CDN服务已经关闭，解决办法请参考<a href="http://www.codelast.com/?p=9278" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这个</span></a>链接。</p>
<p><span style="background-color: rgb(0, 255, 0);">【5】</span>一些无法用MathType复制成LaTex文本的符号怎么输入<br />
如上面所说，用MathType可以直接复制出LaTex文本，不过，在MathType中复制某些符号时会出错，MathType提示&ldquo;转换错误...&rdquo;，这时，你需要做的就是：不要在MathType中输入这些符号，然后复制出数学公式，粘贴到WordPress编辑器中，再自己手工用LaTex语法补上那些符号。<br />
下面列出了一些无法复制的符号的LaTex表达式：<br />
<span style="color:#0000ff;"> <span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_9289d632ac358397245e4dce6ebec96d.gif' style='vertical-align: middle; border: none; padding-bottom:2px;' class='tex' alt="\stackrel \frown {AB}" /></span><script type='math/tex'>\stackrel \frown {AB}</script> </span>（表示&ldquo;弧AB&rdquo;）：&nbsp;<span style="color:#ff0000;">\stackrel \frown {AB}</span><br />
<span style="color:#0000ff;"> <span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_f5412804005d401e47fc9a52ddd6655e.gif' style='vertical-align: middle; border: none; padding-bottom:2px;' class='tex' alt="\bigtriangleup" /></span><script type='math/tex'>\bigtriangleup</script> </span>（表示三角形）：<span style="color:#ff0000;">\bigtriangleup</span><br />
类似于这样的<span style="color:#0000ff;">多行公式</span>： <span class='MathJax_Preview'><img src='https://www.codelast.com/wp-content/plugins/latex/cache/tex_6dcf256c9bfafab3449ad7c6fbb77508.gif' style='vertical-align: middle; border: none; padding-bottom:2px;' class='tex' alt="f(x) = \left\{ {\begin{array}{*{20}{c}}{x + 1,\;x < 1}\\{{x^2},\;x \ge 1}\end{array}} \right." /></span><script type='math/tex'>f(x) = \left\{ {\begin{array}{*{20}{c}}{x + 1,\;x < 1}\\{{x^2},\;x \ge 1}\end{array}} \right.</script> ：在MathType中复制出这个公式时，得到的是一个4行的LaTex表达式，如果你直接把它粘贴到WordPress编辑器中，再发布文章，它是无法被MathJax正确渲染的，你需要做的是把4行的LaTex表达式中的所有换行给<span style="color:#b22222;">删除</span>，合成为一行，就OK了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0);">【6】</span>如果你使用PHP 7，该插件会失效，解决方法看<a href="https://www.codelast.com/?p=10381" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这里</span></a>。</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e7%94%a8latex-for-wordpress%e6%8f%92%e4%bb%b6%e5%9c%a8wordpress%e4%b8%ad%e5%86%99%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]使用memcached为WordPress站点提速</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8memcached%e4%b8%bawordpress%e7%ab%99%e7%82%b9%e6%8f%90%e9%80%9f/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8memcached%e4%b8%bawordpress%e7%ab%99%e7%82%b9%e6%8f%90%e9%80%9f/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sat, 02 Feb 2013 15:38:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[memcached插件]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress memcached plugin]]></category>
		<category><![CDATA[安装memcached插件]]></category>
		<category><![CDATA[配置memcached插件]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=5658</guid>

					<description><![CDATA[<p>
本文的前提条件：你对你的WordPress站点服务器有控制权，例如，你使用的是VPS搭建的WordPress站点，而不是虚拟主机。如果不符合条件就不用往下看了，因为后面的很多操作是需要root权限来安装、配置软件的。另外，我使用的是32位的Linux系统，如果你是64位的系统，可能有些许不一样，或者出现一些文中没有遇到的问题，请注意。</p>
<p>首先说一下使用memcached为WordPress站点提速的意义。由于我不是做前端开发的，所以下面的部分内容说的不一定正确、深刻，您就凑合着看吧。<br />
如果你的WordPress站点访问量很大，那么VPS负载可能就很高，而这其中，可能有很大一部分就是MySQL的负载&#8212;&#8212;它要将大量内容读取出来，并返回给访客。其实这部分工作可以通过缓存来提高性能，<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">memcached</span></a>就是这样一个软件，可以帮助我们实现这一点。<br />
<span id="more-5658"></span><br />
从<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">memcached</span></a>的官方网站介绍中，我们知道它是：</p>
<blockquote>
<p>
		Free &#38; open source, high-performance, distributed memory object caching system.</p>
</blockquote>
<p>说得直白简单一点，它就是把最常访问的那些内容缓存在内存中，有新访客到来的时候，先从内存中找，找到了就直接返回，否则再去查数据库，这样就极大地提高了性能。<br />
有人可能会使用<a href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">WP Super Cache</span></a>这个WordPress插件来为WP提速（而且它的效果似乎更好），但此插件会生成大量缓存文件，占用大量磁盘空间，从而影响WordPress备份文件的大小，这对我来说并不是一个好结果，因此，我没有用它。<br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
那么，在WordPress中，我们怎么使用memcached呢？这不是仅仅安装memcached软件就可以做到的，还要和PHP结合起来，所以涉及到好几个部分，下面分别阐述：<br />
<span style="background-color:#00ff00;">【1】</span>安装memcached<br />
首先我们要从<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer">memcached的官方网站</a>下载一个稳定版，例如，我下载的是 1.4.15 版，然后准备安装它。<br />
但是memcached的根基是一个网络开发库 <a href="http://libevent.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">libevent</span></a>，所以，你要先安装 libevent。我下载的是 2.0.21（稳定版），解压出来，然后编译安装：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/libevent
make
make install
</pre>
<p>注意我安装到了 /usr/local/libevent&#160;目录下。<br />
然后编译安装memcached：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure</pre>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8memcached%e4%b8%bawordpress%e7%ab%99%e7%82%b9%e6%8f%90%e9%80%9f/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>
本文的前提条件：你对你的WordPress站点服务器有控制权，例如，你使用的是VPS搭建的WordPress站点，而不是虚拟主机。如果不符合条件就不用往下看了，因为后面的很多操作是需要root权限来安装、配置软件的。另外，我使用的是32位的Linux系统，如果你是64位的系统，可能有些许不一样，或者出现一些文中没有遇到的问题，请注意。</p>
<p>首先说一下使用memcached为WordPress站点提速的意义。由于我不是做前端开发的，所以下面的部分内容说的不一定正确、深刻，您就凑合着看吧。<br />
如果你的WordPress站点访问量很大，那么VPS负载可能就很高，而这其中，可能有很大一部分就是MySQL的负载&mdash;&mdash;它要将大量内容读取出来，并返回给访客。其实这部分工作可以通过缓存来提高性能，<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">memcached</span></a>就是这样一个软件，可以帮助我们实现这一点。<br />
<span id="more-5658"></span><br />
从<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">memcached</span></a>的官方网站介绍中，我们知道它是：</p>
<blockquote>
<p>
		Free &amp; open source, high-performance, distributed memory object caching system.</p>
</blockquote>
<p>说得直白简单一点，它就是把最常访问的那些内容缓存在内存中，有新访客到来的时候，先从内存中找，找到了就直接返回，否则再去查数据库，这样就极大地提高了性能。<br />
有人可能会使用<a href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">WP Super Cache</span></a>这个WordPress插件来为WP提速（而且它的效果似乎更好），但此插件会生成大量缓存文件，占用大量磁盘空间，从而影响WordPress备份文件的大小，这对我来说并不是一个好结果，因此，我没有用它。<br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
那么，在WordPress中，我们怎么使用memcached呢？这不是仅仅安装memcached软件就可以做到的，还要和PHP结合起来，所以涉及到好几个部分，下面分别阐述：<br />
<span style="background-color:#00ff00;">【1】</span>安装memcached<br />
首先我们要从<a href="http://memcached.org/" target="_blank" rel="noopener noreferrer">memcached的官方网站</a>下载一个稳定版，例如，我下载的是 1.4.15 版，然后准备安装它。<br />
但是memcached的根基是一个网络开发库 <a href="http://libevent.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">libevent</span></a>，所以，你要先安装 libevent。我下载的是 2.0.21（稳定版），解压出来，然后编译安装：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/libevent
make
make install
</pre>
<p>注意我安装到了 /usr/local/libevent&nbsp;目录下。<br />
然后编译安装memcached：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --with-libevent=/usr/local/libevent/ --prefix=/usr/local/memcached
make
make install
</pre>
<p>注意我指定了libevent的安装目录，并且把memcached安装到了 /usr/local/memcached 目录下。<br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【2】</span>启动memcached<br />
安装了memcached软件之后，我们就要启动它了：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
cd /usr/local/memcached/bin/
./memcached -d -m 256 -u root -t 64 -r
</pre>
<p>-d 表示以守护进程的方式启动memcached程序，-m 256 表示最大可使用256M的内存，-u root 我不太明白有什么用（网上的某些教程里有这样用的），-t 64 表示使用64个线程，-r 表示最大化core文件的限制。<br />
这样启动之后，memcached就开始在默认端口 11211 上监听了。<br />
现在再看看进程中是否已经有了memcached：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
[root@localhost]# ps -ef | grep memcached
root      2180     1  0 22:29 ?        00:00:00 ./memcached -d -m 256 -u root -t 64 -r
</pre>
<p>最后再把它加入开机启动项，编辑 /etc/rc.local 文件，添加一句：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
/usr/local/memcached/bin/memcached -d -m 256 -u root -t 64 -r
</pre>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【3】</span>安装PHP的memcached扩展<br />
为了能让WordPress用上我们刚安装的memcached，需要先为PHP安装一个memcached扩展。<br />
到<a href="http://pecl.php.net/package/memcache" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">这个页面</span></a>去下载一个稳定版的memcached扩展，例如，我下载的是2.2.7版，然后解压：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar zxf memcache-2.2.7.tgz
cd memcache-2.2.7
</pre>
<p>如果你没这样装过PHP扩展的话，你会很奇怪地发现，解压出来的目录下竟然没有 configure 文件！没有 configure 文件如何能生成Makefile，如何能编译安装呢？<br />
这个时候，我们需要用PHP安装时附带的 phpize 程序来帮助我们生成configure：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
cd memcache-2.2.7
/usr/local/php/bin/phpize
</pre>
<p>注意，我的PHP是安装在 /usr/local/php 目录下的，如果你的目录不同，请作相应的修改。顺利的话，就会发现生成了configure文件；如果遇到了以下错误：</p>
<blockquote>
<p>
		Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.</p>
</blockquote>
<div>
	<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
	那么，就需要安装以下两个package（如果是Ubuntu，就apt-get install，这里就不废话了）：</div>
<div>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
yum install m4
yum install autoconf
</pre>
</div>
<div>
	然后再重新执行phpize命令，再编译安装：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
make
make install
</pre>
</div>
<div>
	会提示：</div>
<blockquote>
<div>
		Installing shared extensions: &nbsp; &nbsp; /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/</div>
</blockquote>
<div>
	然后修改你的php.ini配置文件，在最后添加：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
[memcache]
extension=memcache.so
</pre>
</div>
<p>最后重启你的web service，如果你用的是nginx，那么需要重启 php-fpm 和 nginx：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
/etc/init.d/php-fpm restart
/etc/init.d/nginx restart
</pre>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【4】</span>安装、配置WordPress的memcached插件<br />
上面的步骤已经够麻烦了，但是到了这一步，你就快成功了。<br />
在WordPress后台的插件安装页面中，搜索&ldquo;memcached&rdquo;，会找到&ldquo;Memcached Object Cache&rdquo;插件，安装之，然后这里要注意了，与平常安装插件不一样的是，安装完这个插件之后，<strong><span style="color:#ff0000;">不要&ldquo;启用&rdquo;它</span></strong>，否则会报错。<br />
我们需要手工把安装插件得到的 object-cache.php&nbsp;文件拷贝到WordPress的 wp-content&nbsp;目录下，它就可以开始工作了（有点奇怪吧）：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
cp wp-content/plugins/memcached/object-cache.php wp-content/
</pre>
<p>然后memcached就开始为你的WordPress默默地&ldquo;做奉献&rdquo;了，尽管你看不到它。如果你不想再管它，那么到这一步就可以收手了，不过，你可能还想知道它工作得怎么样，那么你就要继续看下去。<br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【5】</span>安装memcached的管理插件<br />
同样在WordPress的插件安装界面中搜索&ldquo;WP Memcached Manager&rdquo;，安装此插件，启用它，即可在WordPress管理后台的左侧菜单中，看到多出了一项&ldquo;Memcached&rdquo;：</p>
<div style="text-align: center; ">
	<a href="http://www.codelast.com" target="_blank" rel="noopener noreferrer"><img decoding="async" alt="WordPress memcached menu" src="http://www.codelast.com/wp-content/uploads/2013/02/wp_menu_memcached.jpg" style="width: 153px; height: 82px; " /></a></div>
<p>点击&ldquo;Edit servers&rdquo;，如下图所示的默认server：</p>
<div style="text-align: center; ">
	<a href="http://www.codelast.com" target="_blank" rel="noopener noreferrer"><img decoding="async" alt="WordPress memcached manager add server" src="http://www.codelast.com/wp-content/uploads/2013/02/wp_memcached_manager_add_server.jpg" style="width: 371px; height: 195px; " /></a></div>
<p>然后再回到&ldquo;Memcached&rdquo;菜单，就可以看到下拉列表中多出了一项，即我们刚添加的server，点击&ldquo;Manage Server&rdquo;，就会看到关于memcached的一些统计信息啦：</p>
<div style="text-align: center; ">
	<a href="http://www.codelast.com" target="_blank" rel="noopener noreferrer"><img decoding="async" alt="WordPress memcached manager manage server" src="http://www.codelast.com/wp-content/uploads/2013/02/wp_memcached_manager_manage_server.jpg" style="width: 600px; height: 376px; " /></a></div>
<p>这下踏实了，我们知道memcached确实在工作了，并且hit和miss的数据都知道了。<br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【6】</span>进一步优化<br />
有一个叫做<a href="http://wordpress.org/extend/plugins/batcache/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">Batcache</span></a>的WordPress插件，能为我们上面的工作锦上添花，建议在WordPress后台安装它（不需要配置）。它的原理是：<br />
在没有Batcache、有memcached的情况下，访问WordPress页面时，需要从内存中获取多个缓存对象，而Batcache可以把整个页面作为一个对象缓存，从而从内存中只需要获取一个缓存对象，这样就提高了速度。</p>
<p>至此，我们整个安装、配置memcached的过程就结束了，在访问量很大的时候，你的WordPress站点的性能一定会得到质的提升。</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushPlain.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8memcached%e4%b8%bawordpress%e7%ab%99%e7%82%b9%e6%8f%90%e9%80%9f/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
