gpt4 book ai didi

php - 将多站点 WordPress 应用程序复制到新主机,连接到数据库时出错

转载 作者:行者123 更新时间:2023-11-29 11:21:11 24 4
gpt4 key购买 nike

我已将 WordPress 应用程序复制到新的托管环境。该应用程序启用了子域,但是我们的新托管环境不支持此功能。我已经更新了 .htaccess 以及 wp-config.php 以反射(reflect)新的 URL 和新的数据库。我无法浏览该网站。进入 wp-admin 会看到经典的错误消息:

Error establishing a database connection
If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.

Could not find site example.com. Searched for table wp_blogs in database wp. Is that right?

What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:

wp_users
wp_usermeta
wp_blogs
wp_signups
wp_site
wp_sitemeta
wp_registration_log
wp_blog_versions

我想这与数据库中的 URL 映射有关。请记住,我们正在尝试从子域切换到子目录。除了从子域切换之外,我还必须采取哪些步骤来纠正此问题?

最佳答案

要从子域切换到子目录,您需要执行一些操作。

此论坛主题应该包含所需的大部分详细信息:https://premium.wpmudev.org/forums/topic/reverting-from-subdomains-to-subdirectories-in-multistie

也就是说,当迁移到具有多站点的新主机并出现数据库连接错误时,通常的原因是 wp_blogs 和 wp_sites 表中的不匹配。

如果您可以手动编辑这些表并至少更正您的主域,您应该能够通过网络管理员返回并更正其余部分。

关于php - 将多站点 WordPress 应用程序复制到新主机,连接到数据库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38909241/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com