简体   繁体   English

WP迁移,无法登录到WP管理员

[英]WP migration, can't login to WP admin

I was in the middle of migrating a local WP site to a live server and came across a problem. 我当时正在将本地WP站点迁移到实时服务器,遇到了一个问题。

I edited my WP config file and uploaded it along with the rest of the WP files. 我编辑了WP配置文件,并将其与其余WP文件一起上传。 I also uploaded the mysql database through phpMyAdmin. 我还通过phpMyAdmin上传了mysql数据库。

Once i tried to test the site i got an error message "The page isn't redirecting properly". 一旦我尝试测试该站点,就会收到错误消息“页面无法正确重定向”。 I then, mistakenly, logged in to the admin area and in the Settings > General tab I deleted the localhost part of the URL. 然后,我错误地登录到管理区域,并在“设置”>“常规”选项卡中删除了URL的本地主机部分。 Now I'm unable to log back in to the WP admin area. 现在,我无法重新登录到WP管理区域。

EDIT 编辑

To clarify, my major problem is that i can no longer log in to the wp admin area because of something I've done. 需要澄清的是,我的主要问题是由于执行了某些操作,因此我无法再登录到wp admin区域。 The steps i took to get to this point were: 为此,我采取了以下步骤:

  1. Backed up WP using the BackUpWordpress plugin 使用BackUpWordpress插件备份WP

  2. Edited back up wp-config file with define('WP_HOME','http://example.com'); 使用define('WP_HOME','http://example.com');编辑备份的wp-config文件define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');

  3. Created mySQL database through DreamHost 通过DreamHost创建了mySQL数据库

  4. Changed database info in wp-config file wp-config文件中的数据库信息已更改

  5. Uploaded wp files (not including mySQL backup) to my url using Filezilla 使用Filezilla将wp文件(不包括mySQL备份)上传到我的网址

  6. Imported mySQL database backup to DreamHost 将mySQL数据库备份导入到DreamHost

  7. I then checked the site from my browser, an error message said too many redirects occurred 然后,我从浏览器中检查了该站点,出现错误消息,指出重定向过多

  8. From the wp admin area i went to Settings > General and deleted the localhost part of the url that was displayed. 我从wp管理员区域转到“设置”>“常规”,并删除了所显示网址的localhost部分。

  9. I believe it's due to the previous step I'm now unable to access the wp admin area at all. 我相信这是由于上一步,我现在完全无法访问wp admin区域。

I need a way of getting back into the admin area 我需要一种回到管理区域的方法

You can also edit those options within phpMyAdmin. 您也可以在phpMyAdmin中编辑这些选项。 Go to wp_options and locate siteurl and home. 转到wp_options并找到siteurl和home。 Make sure the URL matches your site URL. 确保URL与您的站点URL相匹配。

You can also edit the site URL in your wp-config.php. 您也可以在wp-config.php中编辑站点URL。

Add these lines somewhere above the /* That's all, stop editing! 将这些行添加到/ *上方的某处,那就停止编辑! Happy blogging. 快乐的博客。 */ line. * /行。

define('WP_HOME','http://my-site.com');
define('WP_SITEURL','http://my-site.com');

This should overwrite your database settings. 这应该覆盖您的数据库设置。

Which version of WordPress do you use? 您使用哪个版本的WordPress?
Can you list the plugins you are using? 您可以列出您正在使用的插件吗?

Have you gone through the basic WordPress troubleshooting steps? 您是否已完成基本的WordPress故障排除步骤?

  • flush any caching plugins you might be running, as well as server and/or browser caches. 刷新您可能正在运行的所有缓存插件以及服务器和/或浏览器缓存。

  • deactivate all plugins to see if this resolves the problem. 停用所有插件以查看是否可以解决问题。 If this works, re-activate the plugins one by one until you find the problematic plugin(s). 如果可行,请逐个重新激活插件,直到找到有问题的插件为止。 Sometimes, an apparently inactive plugin can still cause problems. 有时,表面上不活跃的插件仍然可能导致问题。

  • If you can't get into your admin dashboard , try resetting the plugins folder by FTP or PhpMyAdmin (read http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F if you need help). 如果您无法进入管理控制台 ,请尝试通过FTP或PhpMyAdmin重置插件文件夹(如果需要帮助,请阅读http://codex.wordpress.org/FAQ_Troubleshooting#How_to_deactivate_all_plugins_when_not_able_to_access_the_administrative_menus.3F )。

  • switch to the Twenty Eleven theme (depends on your WordPress version) to rule out any theme-specific problems. 切换到“二十一”主题(取决于您的WordPress版本)以排除任何特定于主题的问题。

  • If you can't log in to change themes, you can remove the theme folders via FTP so the only one is twentyeleven. 如果您无法登录以更改主题,则可以通过FTP删除主题文件夹,因此只有21个文件夹。 That will force your site to use it. 那将迫使您的网站使用它。

  • manual upgrade. 手动升级。 When all else fails, download a fresh copy of the latest.zip file to your computer, and use that to copy up. 如果其他所有方法均失败,则将最新的.zip文件的新副本下载到您的计算机上,然后使用该副本进行复制。 You may need to delete the wp-admin and wp-includes folders on your server. 您可能需要删除服务器上的wp-admin和wp-includes文件夹。 Read the Manual Update directions first: http://codex.wordpress.org/Updating_WordPress#Manual_Update 首先阅读手册更新说明: http : //codex.wordpress.org/Updating_WordPress#Manual_Update

  • check the Master List to see if you're experiencing a known issue 检查主列表,看看您是否遇到已知问题

Login to your wordpress dashboard (wp-admin) and go to Settings -> Permalinks , select Default and save changes. 登录到您的wordpress仪表板(wp-admin)并转到设置 -> 永久链接 ,选择默认并保存更改。

I believe the problem is that studiomed.co.uk is permanently redirected (301) to www.studiomed.co.uk and www.studiomed.co.uk is permanently redirected (301) to studiomed.co.uk 我认为问题在于studiomed.co.uk被永久重定向(301)到www.studiomed.co.uk和www.studiomed.co.uk被永久重定向(301)到studiomed.co.uk

Login to your Dreamhost account go to Domains -> Manage Domains and choose one of the three options there are in " Do you want the www in your URL? ". 登录到您的Dreamhost帐户,转到“域 -> 管理域”,然后选择“ 您要在网址中使用www吗? ”中的三个选项之一。

After that use an ftp program to download the .htaccess file that exists in your root installation of wordpress and open it with your favorite editor. 之后,使用ftp程序下载wordpress根安装中存在的.htaccess文件,并使用您喜欢的编辑器将其打开。 Check if you have any kind of redirection in the .htaccess file. 检查.htaccess文件中是否有任何重定向。

Update all urls(path) using this querys then check:-- 使用此查询更新所有网址(路径),然后检查:-

Use this querys for change all urls(path) for db then check 使用此查询来更改数据库的所有URL(路径),然后检查

UPDATE wp_options SET option_value = replace(option_value, 'http://live_ste_path.com', 'http://localhost/local_site_path') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'http://live_ste_path.com', 'http://localhost/local_site_path');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://live_ste_path.com','http://localhost/local_site_path')`

[WSOD RESOLVED] [已解决WSOD]

Since I could not find any solution to my problem by googling around, a crucial tracking info I finally found in WP error logs. 由于无法通过谷歌搜索来解决问题,因此最终在WP错误日志中找到了关键的跟踪信息。 So I would recommend to inspect logs before spending to much time looking for a proper answer by google. 因此,我建议您先检查日志,然后再花费大量时间寻找Google的正确答案。

After migration from an old web host to a new one, in my multisite environment all sites were working. 从旧的虚拟主机迁移到新的虚拟主机之后,在我的多站点环境中,所有站点都可以正常工作。 Also, I was able to administer all subsites - but one! 另外,我还可以管理所有子站点-但是一个! Trying wp-admin login to that site led me to fatal white screen. 尝试以wp-admin登录该站点使我陷入致命的白屏。 Without any message or any indication about the reason. 没有任何消息或任何有关原因的指示。 And the culprit was corrupted file /public_html/subsite-x/wp-admin/admin.php. 罪魁祸首是文件/public_html/subsite-x/wp-admin/admin.php损坏。 I really could not understand how that happened, just might suppose it appeared somehow while transferring files (FTP) from old host to a new one. 我真的不明白这是怎么发生的,可能只是假设它在将文件(FTP)从旧主机传输到新主机时以某种方式出现了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM