WordPress: Login Trouble:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
第1行: 第1行:
If you are having trouble logging in to your WordPress [[Wordpress:Administration Panels]], here are some possible solutions.
If you are having trouble logging in to your WordPress [[Wordpress:Administration Panels]], here are some possible solutions.
如果你有困难登录到WordPress[[Wordpress:Administration Panels|管理面板]],下面是一些可能用到的解决办法。


== Enable Cookies ==
== Enable Cookies ==
== 启用Cookies ==


Make sure that cookies are enabled for your browser.
Make sure that cookies are enabled for your browser.
确保你的浏览器能够启用cookies.


* Clear your browser cookies.
* Clear your browser cookies.
*清除你的浏览器cookies.
* Clear your browser cache.
* Clear your browser cache.
*清除你的浏览器高速缓冲存储。


== Disable Plugins ==
==使插件处于没用的状态 ==


Some [[Wordpress:Plugins|WordPress Plugins]] may interfere with the login process. Disable all of your WordPress Plugins, either through the admin panel or by removing them from the <tt>/wp-content/plugins/</tt> folder, so they will not be recognized by the program.
Some [[Wordpress:Plugins|WordPress Plugins]] may interfere with the login process. Disable all of your WordPress Plugins, either through the admin panel or by removing them from the <tt>/wp-content/plugins/</tt> folder, so they will not be recognized by the program.


一些[[Wordpress:Plugins|WordPress 插件]]可能干预登录过程。通过管理面板,或者通过将插件从<tt>/wp-content/plugins/</tt>文件夹中移走,来使WordPress的所有插件不起作用,这样程序就不能识别插件了。
== New Login File ==
== New Login File ==
==新的登录文件 ==


Sometimes the <tt>wp-login.php</tt> file may have been corrupted or uploaded incorrectly.
Sometimes the <tt>wp-login.php</tt> file may have been corrupted or uploaded incorrectly.
有时<tt>wp-login.php</tt>文件可能已经毁坏了或者错误地上载了。
* Delete <tt>wp-login.php</tt> off of your server and upload a new copy from a fresh WordPress download. Remember, overwriting file via [[Wordpress:FTP Clients|FTP]] can lead to incomplete transfers.
*从你的服务器上删除掉<tt>wp-login.php</tt>并且从一个刷新的WordPress下载文件中,上载一个新的复制的文件。注意通过[[Wordpress:FTP Clients|FTP]]写地过多的文件可能会导致不完全的转移。


* Delete <tt>wp-login.php</tt> off of your server and upload a new copy from a fresh WordPress download. Remember, overwriting file via [[Wordpress:FTP Clients|FTP]] can lead to incomplete transfers.
* Edit <tt>wp-login.php</tt> as follows:
* Edit <tt>wp-login.php</tt> as follows:
*将<tt>wp-login.php</tt>编辑为以下的形式:
** Go to the <tt>case retrievepassword</tt> section, found under this comment:  
** Go to the <tt>case retrievepassword</tt> section, found under this comment:  
**转到<tt>case 重新得到密码</tt>部分,在这个评论下找到:
  // redefining user_login ensures we return the right case in the email
  // redefining user_login ensures we return the right case in the email
//从新定义用户_登录确保我们将正确的case返回到了邮件中。
::Replace:
::Replace:
  $user_login = $user_data["user_login"];
  $user_login = $user_data["user_login"];
::With:
::With:
  $user_login = $user_data->user_login;
  $user_login = $user_data->user_login;
:替换:
$user_login = $user_data["user_login"];
::为:
$user_login = $user_data->user_login;


== Edit Users Table ==
== Edit Users Table ==
== 编辑用户列表 ==


[[Wordpress:WordPress_Backups#Accessing_phpMyAdmin|Access your site's phpMyAdmin]] and edit the database carefully.
[[Wordpress:WordPress_Backups#Accessing_phpMyAdmin|Access your site's phpMyAdmin]] and edit the database carefully.
[[Wordpress:WordPress_Backups#Accessing_phpMyAdmin|进入你的站点的 phpMyAdmin]] 并且仔细地编辑数据库。


* Open the WordPress database.
* Open the WordPress database.
*打开WordPress数据库
* Click on the users table in the left menu (default is <tt>wp_users</tt>, or <tt>''yourprefix''_users </tt> if you defined a different table prefix.)
* Click on the users table in the left menu (default is <tt>wp_users</tt>, or <tt>''yourprefix''_users </tt> if you defined a different table prefix.)
*点击一下左边菜单里的用户表(如果你确定了一个不同的表格前缀,默认情况下是<tt>wp_users</tt>, or <tt>''yourprefix''_users </tt>)
* Click '''BROWSE'''.
* Click '''BROWSE'''.
点击'''浏览'''。
* Click on the '''EDIT''' button next to the admin user.
* Click on the '''EDIT''' button next to the admin user.
*点中管理用户旁边的'''EDIT'''
* Delete whatever is in the password field.
* Delete whatever is in the password field.
*删除密码栏中所有的内容。
* Using the [http://bfl.rctek.com/tools/?tool=hasher md5 hasher], enter your desired password, and copy the hash that it generates.
* Using the [http://bfl.rctek.com/tools/?tool=hasher md5 hasher], enter your desired password, and copy the hash that it generates.
* 使用[http://bfl.rctek.com/tools/?tool=hasher md5 hasher],输入你想要的密码,并且复制一些随之产生的无用信息。
* Paste the hash in the password field for user <tt>admin</tt>.
* Paste the hash in the password field for user <tt>admin</tt>.
*在用户<tt>admin</tt>.的密码栏中粘贴这些无用信息。
* Save the info in the database.
* Save the info in the database.
*在数据库中保存信息。
* Log in to WordPress using "admin" and the password you used to create the hash.
* Log in to WordPress using "admin" and the password you used to create the hash.
*使用"admin"和你用来创建无用信息的密码来登录到WordPress


For more information, see [[Wordpress:Resetting Your Password]].
For more information, see [[Wordpress:Resetting Your Password]].
更多信息请看,[[Wordpress:Resetting Your Password|重新设定你的密码]]


== Problems with Password ==
== Problems with Password ==
== 与密码相关的问题==


For information on problems logging in due to a wrong or lost password, see [[Wordpress:Resetting Your Password]].
For information on problems logging in due to a wrong or lost password, see [[Wordpress:Resetting Your Password]].
关于因为密码错误或者密码丢失而引起的登录问题,请看[[Wordpress:Resetting Your Password|重新设置你的密码]].


Please remember, the Username and Password fields are case sensitive!
Please remember, the Username and Password fields are case sensitive!
请记住,用户名和密码栏是要求区分大小写的!


== Site URL Redirecting ==
== 改变 URL 站点 ==
In certain cases your WordPress address URI may have been reset.   
In certain cases your WordPress address URI may have been reset.   
在某些情况下,你的WordPress地址URI也许要重新设置.


*Check the '''siteurl''' value in the ''wp-options'' table of your WordPress database.  A guide to doing this is available [http://www.tamba2.org.uk/wordpress/site-url/ here].
*Check the '''siteurl''' value in the ''wp-options'' table of your WordPress database.  A guide to doing this is available [http://www.tamba2.org.uk/wordpress/site-url/ here].
在你的WordPress数据库的''wp-options''中核实一下'''siteurl'''值.在[http://www.tamba2.org.uk/wordpress/site-url/ 这儿].可以找到怎样做的指南.
*Is it set as <tt><nowiki>http:/</nowiki></tt>?
*Is it set as <tt><nowiki>http:/</nowiki></tt>?
*它设置成了<tt><nowiki>http:/</nowiki></tt>?
*If it is, change '''site_url''' to the correct value.
*If it is, change '''site_url''' to the correct value.
*如果是的话,就将'''site_url'''改为正确的值.
*Open ''wp-login.php'' in a text-editor and comment or delete the following lines:
*Open ''wp-login.php'' in a text-editor and comment or delete the following lines:
*在一个文本编辑器中打开''wp-login.php'',评论或者删除下面这些行:


<pre>// If someone has moved WordPress let's try to detect it
<pre>// If someone has moved WordPress let's try to detect it
//if ( dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
//if ( dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
  // update_option('siteurl', dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );</pre>
  // update_option('siteurl', dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );</pre>
<pre>// 如果有人移动了WordPress, 我们试着将它删除掉.
//if ( dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
// 更新选择('siteurl', dirname('<nowiki>http://</nowiki>' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );</pre>


== Secure HTTPS ==
== Secure HTTPS ==
== 保护 HTTPS ==


If you are having a problem with secure HTTPS, change the following line in <tt>wp-includes/vars.php</tt> from:  
If you are having a problem with secure HTTPS, change the following line in <tt>wp-includes/vars.php</tt> from:  
如果你有保护HTTPS方面的问题,请将下面<tt>wp-includes/vars.php</tt>的行,从:
<pre><nowiki>define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>


<pre><nowiki>define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>
<pre><nowiki>define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>


To:
To:
改为:


<pre><nowiki>define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>
<pre><nowiki>define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>
<pre><nowiki>define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );</nowiki></pre>


Be sure also to change the URL in OPTIONS to <nowiki>https://</nowiki>.
Be sure also to change the URL in OPTIONS to <nowiki>https://</nowiki>.
确保将OPTIONS中的URL改为<nowiki>https://</nowiki>.


== Headers Already Sent ==
== Headers Already Sent ==
== 头文件已经发出 ==


If you get an error about '''headers already sent''', see [[Wordpress:FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F|Solving the Headers Already Being Sent Problem]] in the [[Wordpress:FAQ]].
If you get an error about '''headers already sent''', see [[Wordpress:FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F|Solving the Headers Already Being Sent Problem]] in the [[Wordpress:FAQ]].
如果你遇到了一个'''头文件已经发出'''的错误,在[[Wordpress:FAQ|常见问题解答]]上看一下[[Wordpress:FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F|解决头文件已经发出的问题]]


== Check Your URL Options ==
== Check Your URL Options ==
== 检查你的URL 选项 ==
In some situations, your blog can be seen from inside your domain, but not outside. Following the instruction above about changing the ''wp-options'' [[Wordpress:Glossary|MySQL]] table might still result in login failure.  
In some situations, your blog can be seen from inside your domain, but not outside. Following the instruction above about changing the ''wp-options'' [[Wordpress:Glossary|MySQL]] table might still result in login failure.  
在一些情形下,从你的域里可以看见你的博客,但从域外就看不见了.遵循以上关于改变''wp-选项'' [[Wordpress:Glossary|MySQL]]表的说明,可能仍然登录不了.


In this event, double-check your ''wp-options'' table '''siteurl''' (WordPress address URL) and '''home''' (Blog Address URL) values to make sure they reference the '''same''' base externally available address; i.e., http:/blog.yourdomain.com. The standard install may set them to your local (internal) host name, such as http://servername
In this event, double-check your ''wp-options'' table '''siteurl''' (WordPress address URL) and '''home''' (Blog Address URL) values to make sure they reference the '''same''' base externally available address; i.e., http:/blog.yourdomain.com. The standard install may set them to your local (internal) host name, such as http://servername
在这种情况下,双重选择你的''wp-选项''表'''siteurl'''(WordPress 地址 URL)和'''主页'''(博客地址URL)值,确保它们提及了'''同一个'''对外的基数:例如,. http:/blog.yourdomain.com.标准的安装可能把它们设置为你的本地的(内在的)主机名,像http://servername


== Check your Firewall ==
== Check your Firewall ==
==检查你的防火墙 ==
Some firewalls (e.g., eTrust Personal Firewall) block you from logging in to WordPress. Disable your firewall and try to log in again.
Some firewalls (e.g., eTrust Personal Firewall) block you from logging in to WordPress. Disable your firewall and try to log in again.
一些防火墙(例如, eTrust Personal 防火墙)阻止你登录到WordPress.禁用你的防火墙,并且尝试再次登录.


== If All Else Fails ==
== If All Else Fails ==
==如果所有其它的措施失败 ==
If these steps fail, please indicate that you have tried all these possible solutions when posting at the [http://wordpress.org/support WordPress Support Forum]. Be sure to give [[Wordpress:Finding_Server_Info|details of your server setup]], if you know it, including mySQL and PHP versions, as well as your operating system (OS), browser, and the WordPress version that is causing these problems.
If these steps fail, please indicate that you have tried all these possible solutions when posting at the [http://wordpress.org/support WordPress Support Forum]. Be sure to give [[Wordpress:Finding_Server_Info|details of your server setup]], if you know it, including mySQL and PHP versions, as well as your operating system (OS), browser, and the WordPress version that is causing these problems.


当这些步骤都失败了,当你在[http://wordpress.org/support WordPress 支持论坛]上发帖时,请表明你已经尝试了这些可能的解决办法.如果你知道的话,确保你提供了[[Wordpress:Finding_Server_Info|你的服务器设置的详细信息]],包括mySQL,PHP版本,你的操作系统(OS),浏览器和造成这些麻烦的WOrdPress版本。
{{Copyedit}}


{{Copyedit}}
{{Copyedit}}

2008年3月26日 (三) 10:11的版本

If you are having trouble logging in to your WordPress Wordpress:Administration Panels, here are some possible solutions.

如果你有困难登录到WordPress管理面板,下面是一些可能用到的解决办法。

Enable Cookies

启用Cookies

Make sure that cookies are enabled for your browser. 确保你的浏览器能够启用cookies.

  • Clear your browser cookies.
  • 清除你的浏览器cookies.
  • Clear your browser cache.
  • 清除你的浏览器高速缓冲存储。

使插件处于没用的状态

Some WordPress Plugins may interfere with the login process. Disable all of your WordPress Plugins, either through the admin panel or by removing them from the /wp-content/plugins/ folder, so they will not be recognized by the program.

一些WordPress 插件可能干预登录过程。通过管理面板,或者通过将插件从/wp-content/plugins/文件夹中移走,来使WordPress的所有插件不起作用,这样程序就不能识别插件了。

New Login File

新的登录文件

Sometimes the wp-login.php file may have been corrupted or uploaded incorrectly. 有时wp-login.php文件可能已经毁坏了或者错误地上载了。

  • Delete wp-login.php off of your server and upload a new copy from a fresh WordPress download. Remember, overwriting file via FTP can lead to incomplete transfers.
  • 从你的服务器上删除掉wp-login.php并且从一个刷新的WordPress下载文件中,上载一个新的复制的文件。注意通过FTP写地过多的文件可能会导致不完全的转移。
  • Edit wp-login.php as follows:
  • wp-login.php编辑为以下的形式:
    • Go to the case retrievepassword section, found under this comment:
    • 转到case 重新得到密码部分,在这个评论下找到:
// redefining user_login ensures we return the right case in the email

//从新定义用户_登录确保我们将正确的case返回到了邮件中。

Replace:
$user_login = $user_data["user_login"];
With:
$user_login = $user_data->user_login;


替换:
$user_login = $user_data["user_login"];
为:
$user_login = $user_data->user_login;


Edit Users Table

编辑用户列表

Access your site's phpMyAdmin and edit the database carefully.

进入你的站点的 phpMyAdmin 并且仔细地编辑数据库。


  • Open the WordPress database.
  • 打开WordPress数据库
  • Click on the users table in the left menu (default is wp_users, or yourprefix_users if you defined a different table prefix.)
  • 点击一下左边菜单里的用户表(如果你确定了一个不同的表格前缀,默认情况下是wp_users, or yourprefix_users
  • Click BROWSE.

点击浏览

  • Click on the EDIT button next to the admin user.
  • 点中管理用户旁边的EDIT
  • Delete whatever is in the password field.
  • 删除密码栏中所有的内容。
  • Using the md5 hasher, enter your desired password, and copy the hash that it generates.
  • 使用md5 hasher,输入你想要的密码,并且复制一些随之产生的无用信息。
  • Paste the hash in the password field for user admin.
  • 在用户admin.的密码栏中粘贴这些无用信息。
  • Save the info in the database.
  • 在数据库中保存信息。
  • Log in to WordPress using "admin" and the password you used to create the hash.
  • 使用"admin"和你用来创建无用信息的密码来登录到WordPress

For more information, see Wordpress:Resetting Your Password. 更多信息请看,重新设定你的密码

Problems with Password

与密码相关的问题

For information on problems logging in due to a wrong or lost password, see Wordpress:Resetting Your Password. 关于因为密码错误或者密码丢失而引起的登录问题,请看重新设置你的密码.


Please remember, the Username and Password fields are case sensitive! 请记住,用户名和密码栏是要求区分大小写的!

改变 URL 站点

In certain cases your WordPress address URI may have been reset. 在某些情况下,你的WordPress地址URI也许要重新设置.

  • Check the siteurl value in the wp-options table of your WordPress database. A guide to doing this is available here.

在你的WordPress数据库的wp-options中核实一下siteurl值.在这儿.可以找到怎样做的指南.

  • Is it set as http:/?
  • 它设置成了http:/?
  • If it is, change site_url to the correct value.
  • 如果是的话,就将site_url改为正确的值.
  • Open wp-login.php in a text-editor and comment or delete the following lines:
  • 在一个文本编辑器中打开wp-login.php,评论或者删除下面这些行:
// If someone has moved WordPress let's try to detect it
//if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
 // update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );


// 如果有人移动了WordPress, 我们试着将它删除掉.
//if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
 // 更新选择('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );

Secure HTTPS

保护 HTTPS

If you are having a problem with secure HTTPS, change the following line in wp-includes/vars.php from:

如果你有保护HTTPS方面的问题,请将下面wp-includes/vars.php的行,从:

define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );


define('COOKIEPATH', preg_replace('|http://[^/]+|i', '', get_settings('home') . '/' ) );

To:

改为:

define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) );


Be sure also to change the URL in OPTIONS to https://.

确保将OPTIONS中的URL改为https://.

Headers Already Sent

头文件已经发出

If you get an error about headers already sent, see Solving the Headers Already Being Sent Problem in the Wordpress:FAQ.

如果你遇到了一个头文件已经发出的错误,在常见问题解答上看一下解决头文件已经发出的问题


Check Your URL Options

检查你的URL 选项

In some situations, your blog can be seen from inside your domain, but not outside. Following the instruction above about changing the wp-options MySQL table might still result in login failure.

在一些情形下,从你的域里可以看见你的博客,但从域外就看不见了.遵循以上关于改变wp-选项 MySQL表的说明,可能仍然登录不了.

In this event, double-check your wp-options table siteurl (WordPress address URL) and home (Blog Address URL) values to make sure they reference the same base externally available address; i.e., http:/blog.yourdomain.com. The standard install may set them to your local (internal) host name, such as http://servername

在这种情况下,双重选择你的wp-选项siteurl(WordPress 地址 URL)和主页(博客地址URL)值,确保它们提及了同一个对外的基数:例如,. http:/blog.yourdomain.com.标准的安装可能把它们设置为你的本地的(内在的)主机名,像http://servername


Check your Firewall

检查你的防火墙

Some firewalls (e.g., eTrust Personal Firewall) block you from logging in to WordPress. Disable your firewall and try to log in again.

一些防火墙(例如, eTrust Personal 防火墙)阻止你登录到WordPress.禁用你的防火墙,并且尝试再次登录.

If All Else Fails

如果所有其它的措施失败

If these steps fail, please indicate that you have tried all these possible solutions when posting at the WordPress Support Forum. Be sure to give details of your server setup, if you know it, including mySQL and PHP versions, as well as your operating system (OS), browser, and the WordPress version that is causing these problems.

当这些步骤都失败了,当你在WordPress 支持论坛上发帖时,请表明你已经尝试了这些可能的解决办法.如果你知道的话,确保你提供了你的服务器设置的详细信息,包括mySQL,PHP版本,你的操作系统(OS),浏览器和造成这些麻烦的WOrdPress版本。

This article is [[WordPress::Category:Copyedits|marked]] as in need of editing. You can help Codex by editing it.

This article is [[WordPress::Category:Copyedits|marked]] as in need of editing. You can help Codex by editing it.