WordPress:Login Trouble

来自站长百科
Xxf3325讨论 | 贡献2008年3月22日 (六) 15:36的版本 (新页面: If you are having trouble logging in to your WordPress Administration Panels, here are some possible solutions. == Enable Cookies == Make sure that cookies are enabled for your brow...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

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

Enable Cookies

Make sure that cookies are enabled for your browser.

  • Clear your browser cookies.
  • Clear your browser cache.

Disable Plugins

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.

New Login File

Sometimes the wp-login.php file may have been corrupted or uploaded incorrectly.

  • 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.
  • Edit wp-login.php as follows:
    • Go to the case retrievepassword section, found under this comment:
// redefining user_login ensures we return the right case in the email
Replace:
$user_login = $user_data["user_login"];
With:
$user_login = $user_data->user_login;

Edit Users Table

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

  • Open the WordPress database.
  • Click on the users table in the left menu (default is wp_users, or yourprefix_users if you defined a different table prefix.)
  • Click BROWSE.
  • Click on the EDIT button next to the admin user.
  • Delete whatever is in the password field.
  • Using the md5 hasher, enter your desired password, and copy the hash that it generates.
  • Paste the hash in the password field for user admin.
  • Save the info in the database.
  • Log in to WordPress using "admin" and the password you used to create the hash.

For more information, see Resetting Your Password.

Problems with Password

For information on problems logging in due to a wrong or lost password, see Resetting Your Password.

Please remember, the Username and Password fields are case sensitive!

Site URL Redirecting

In certain cases your WordPress address URI may have been reset.

  • Check the siteurl value in the wp-options table of your WordPress database. A guide to doing this is available here.
  • Is it set as http:/?
  • If it is, change site_url to the correct value.
  • Open wp-login.php in a text-editor and comment or delete the following lines:
// 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']) );

Secure HTTPS

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

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

To:

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

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

Headers Already Sent

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

Check Your URL Options

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.

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

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.

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.


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