WordPress:Answers-Troubleshooting

来自站长百科
Fludlen讨论 | 贡献2008年9月19日 (五) 16:29的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

These FAQs have been deprecated. You will find the new updated Frequently Asked Questions on the new pages for the WordPress:FAQ.

这些常见问题解答已经取消了。你在常见问题解答的新的页面上会看到新的已更新的常见问题解答

Back to FAQ

返回到常见问题解答

CSS Problems

CSS 问题

The following are articles that will help you troubleshoot and solve many of your CSS problems:

下面的这些文章会帮助你发现并且解决许多CSS问题:

No posts matched your criteria

没有文章匹配你的标准

Clear your browser cache and cookies. This may sort this issue. Read WordPress:I Make Changes and Nothing Happens for more information. Also, check your search.php and index.php template files for errors.

清除你的浏览器储存和cookies。这样可能能解决问题。更多的信息,请阅读我更改了,但是什么变化也没有出现。同时检查你的search.phpindex.php模板文件上的错误。

base64 encoding

base64 编码

If the password emailed to you looks strange, the following article might clear this up: Solving Garbled Text.

如果用电子邮件向你发送的密码看起来很奇怪,下面的文章可能会帮你解决:解决断章取义的文本问题

Errorcode 13

Errorcode 13

The Problem: The MySQL variable tmpdir is set to a directory that cannot be written to when using PHP to access MySQL.

问题:MySQL变数设置到目录,使用PHP访问MySQL的时候,不能够编写这个目录。

To verify this, enter MySQL at the command line and type show variables;

要检验这个,在命令行中输入MySQL并且输入显示变数;

You'll get a long list and one of them will read: tmpdir = /somedir/ (whatever your setting is.)

你会得到很长的列表,其中一项是:tmpdir = /somedir/(不管你的设置是什么。) The Solution: Alter the tmpdir variable to point to a writable directory.

解决方法:将tmpdir变数更改,指向可写的目录。

The Steps: 步骤:

  1. Find the my.cnf file. On *nix systems this is usually in /etc/.
  2. Once found, open this in a simple text editor and find the [mysqld] section.
  3. Under this section, find the tmpdir line. If this line is commented (has a # at the start), delete the # and edit the line so that it reads: tmpdir = /writable/dir where /writable/dir is a directory to which you can write. Some use /tmp, or you might also try /home//.
  4. Save the file.
  5. Shutdown MySQL by typing mysqlshutdown -u -p shutdown.
  6. Start MySQL by going to the MySQL directory and typing ./bin/safe_mysqld &. Usually the MySQL directory is in /usr/local or sometimes in /usr/ on Linux systems.


  1. 找到 my.cnf文件。在 *nix 系统,这通常在/etc/
  2. 找打文件后,在简单的文本编辑器中打开这个文件并且找到[mysqld]部分。
  3. 在这个部分的下面,找到tmpdir 行。如果这一行已经被评论 (行开头有个 #), 删除 # 并且编辑这一行: tmpdir = /writable/dir 其中 /writable/dir是个你可以编写的目录。一些人使用 /tmp, 你也可以尝试使用 /home//
  4. 保存文件。
  5. 通过输入mysqlshutdown -u -p shutdown,关闭MySQL。
  6. 通过进入MySQL目录并且输入./bin/safe_mysqld &,启动MySQL。 通常MySQL 目录位于 /usr/local 或者有时候位于Linux系统上的/usr/

If none of this make sense and you have someone to administrate your system for you, show the above to them and they should be able to figure it out.

如果这些操作都不起作用,而且你是让其他人管理你的系统,你可以向他们显示上述的操作,他们能够解决问题。

Error 28

错误28

This is a MySQL error and has nothing to do with WordPress directly. You should probably contact your host about it. Some users have reported that running a repair table command in phpMyAdmin fixed the problem.

这是个MySQL错误与WordPress没有直接的联系。你可能要联系你的主机,说明这个错误。一些用户指出在phpMyAdmin中运行修复表格命令行能够解决这个问题。

You can also check this newsletter on Error 28, and how to avoid it at MySQL.com

你也可以在MySQL.com上查看错误28的即时消息,以及怎样避免这个错误。

Headers already sent

已经发送了标头

Description: You get a warning message on your browser that says:

描述:你在浏览器上得到一条警告信息,显示:

Warning: Cannot modify header information - headers already sent by (output started at 警告: 不能够更改标头信息- 标头已经发送 (output started at

Reason and Solution :

原因和解决方法 :

It is usually because there are spaces, new lines, or other garbage before an opening <?php tag or after a closing ?> tag, typically in wp-config.php. This could be true about some other file too, so please check the error message, as it will list the specific file name where the error occurred (see "Interpreting the Error Message" below). Replacing the faulty file with one from your most recent backup or one from a fresh WordPress download is your best bet, but if neither of those are an option, please follow the steps below.

通常因为在开放的<?php标签或者关闭的?> tag标签后面,特别是在wp-config.php中,有空格,新行,和其它无用标记。其它文件也会出现这样的情况,因此请查看错误信息,上面会列出出现错误的文件名称(请看看下面的"解释错误信息")。使用你最近更新的备份中的文件取代有问题的文件,或者用你最新下载的WordPress文件取消有文件的问题,都是最好的方法。但是如果这两种方法都行不通,请遵循下面的步骤。

Just because you cannot see anything does not mean that PHP sees the same.

你看不到任何内容并不能够代表PHP也不能够看到任何内容。

  1. Download the file mentioned in the error message.
  1. 下载错误信息中提到的文件。
  1. Open that file in a plain text editor (NOT MS Word or similar. Notepad or BBEdit are fine).
  1. 在一个纯文本编辑器中打开文件(不是MS Word或者类似的。Notepad 或者 BBEdit也行)。
  1. Check that the very first characters are <?php
  1. 核实最先字符是<?php
  2. Check that the very last characters are ?>
  1. 核实最后的字符是?>

To be sure about the end of the file, do this:

确定结束文件,请操作:

  1. Place the cursor between the ? and >
  1. 在?和 >之间放上鼠标
  1. Now press the DELETE key on your computer
  1. 现在按住你的电脑上的DELETE键
    • Note to MAC users: The "DELETE" key on a PC deletes characters to the right of the cursor. That's the key meant here.
    • MAC用户注意:个人电脑上的"DELETE"键删除了鼠标右边的字符。那是这里提到的键。
  1. Keep that key pressed
  1. 安装那个键
  1. For at least 15 seconds
  1. 至少按15秒
  1. Now type > and
  2. 现在输入>并且
  1. save without pressing any other key at all.
  1. 不要输入其它键,保存
  1. If you press another key, you will bring the problem back.
  1. 如果你按了其它键,你将会又遇到麻烦。

Interpreting the Error Message:

解释错误信息: If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

如果错误信息显示:警告:不能更改标头信息-在第42行/path/blog/wp-login.php,标头已经发送(从/path/blog/wp-config.php:34开始输出),然后问题出现在wp-config.php的第#34行,而不是wp-login.php的第#42行。在这里,wp-login.php的第#42行是问题所在。受到wp-config.php的第#34行的的过度的空格的影响。

If the error message states: Warning: Cannot modify header information - headers already sent by (output started at /path/wp-admin/admin-header.php:8) in /path/wp-admin/post.php on line 569, then the problem is at line #8 of admin-header.php, not line #569 of post.php. In this scenario, line #569 of post.php is the victim. It is being affected by the excess whitespace at line #8 of admin-header.php.

如果错误信息显示:警告:不能更改标头信息-在第42行/path/blog/wp-login.php,标头已经发送(从/path/wp-admin/admin-header.php:8开始输出)在/path/wp-admin/post.php on line 569中,然后问题出现在admin-header.php的第#8行,而不是post.php的第#569行。在这里,post.php的第#569行是问题所在。受到admin-header.php的第#8行的的过多的空格的影响。

No Quicktag buttons in Safari

Safari中没有Quicktag按钮

Description: The Quicktag buttons in the Write interface do not display when using Apple's Safari browser.

描述:使用Apple的Safari浏览器时,写界面中的Quicktag按钮不显示。

Reason and Solution :

原因和解决方法 :

In Safari, the Quicktag buttons will function, but not as intended. This is due to a bug in Safari, not WordPress. Since the WordPress developers have no way of correcting this, they have chosen to disable the Quicktag buttons for Safari users. At this point in time, there are a few choices to make. One could use Firefox, or comment lines 581 and 589 in /wp-admin/admin-functions.php .

在Safari中,Quicktag按钮能够运行,但是不如想象地那样运行。这是因为Safari而不是WordPress中的程序缺陷问题。因为WordPress开发人员没有方法来解决这个问题,他们只能够选择为Safari用户取消Quicktag按钮。这时,可以做出一些选择。一种是可以使用Firefox,或者在/wp-admin/admin-functions.php中,comment lines 581 和 589。

For example, change this:

例如,将这个:

function the_quicktags () {
// Browser detection sucks, but until Safari supports 
the JS needed for this to work people just assume it's a bug in WP
if ( !strstr($_SERVER['HTTP_USER_AGENT'], 'Safari') ) :
echo '
<div id="quicktags">
<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' 
. __('Help with quicktags') . '">' . __('Quicktags') . '</a>:
<script src="quicktags.js" type="text/javascript"></script>
<script type="text/javascript">edToolbar();</script>
';
echo '</div>';
endif;
}


function the_quicktags () {
// Browser detection sucks, but until Safari supports 
the JS needed for this to work people just assume it's a bug in WP
if ( !strstr($_SERVER['HTTP_USER_AGENT'], 'Safari') ) :
echo '
<div id="quicktags">
<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' 
. __('Help with quicktags') . '">' . __('Quicktags') . '</a>:
<script src="quicktags.js" type="text/javascript"></script>
<script type="text/javascript">edToolbar();</script>
';
echo '</div>';
endif;
}

to this: 更改为:

function the_quicktags () {
// Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
//if ( !strstr($_SERVER['HTTP_USER_AGENT'], 'Safari') ) :
echo '
<div id="quicktags">
<a href="http://wordpress.org/docs/reference/post/#quicktags" title="' 
. __('Help with quicktags') . '">' . __('Quicktags') . '</a>:
<script src="quicktags.js" type="text/javascript"></script>
<script type="text/javascript">edToolbar();</script>
';
echo '</div>';
//endif;
}

Emailed passwords not received

没有收到带有密码的电子邮件

Description: When users try to register with your blog or change their passwords by entering their username and email, Wordpress says that their password has been emailed to them, but it's never received.

描述:当用户试着在你的博客上注册或者通过输入他们的用户名和电子邮件来更改密码的时候,WordPress显示他们的密码已经发送给他们了,但是他们没有收到邮件。

Reason and Solution: Wordpress uses the standard php mail function, which uses sendmail. No account information is needed. This is not generally a problem if you're using a hosting service, but if you're using your own box and don't have an SMTP server, the mail won't ever send. If you're using a *NIX box, you should have either postfix or sendmail on your machine; you'll just need to set them up (google for how-to's). If you don't want to go through setting up a complete mail server on you *NIX box you may find ssmtp useful - it provides "A secure, effective and simple way of getting mail off a system to your mail hub". On a Windows machine, try a sendmail emulator like Glob SendMail.

原因和解决方法:Wordpress使用标准的php邮件函数,这个函数使用sendmail。不需要帐户信息。如果你正使用托管服务,但是如果你正使用自己的框而且没有SMTP服务器,邮件永远都不会发送给你。如果你正使用*NIX框,你的电脑上应该有postfix 或者sendmail;你只要将这些设置好就行了(google for how-to's)。如果你不希望在你的*NIX框中设置完整的邮件服务器,你可能觉得ssmtp有用-提供"安全,有效的邮件接受系统"。在Windows电脑上,尝试sendmail emulator,如Glob SendMail

More help can be found on the forums at: http://wordpress.org/support/topic.php?id=24981

可以在http://wordpress.org/support/topic.php?id=24981的论坛上找到更多的帮助

Back to FAQ

返回到常见问题解答