迁移后 Wordpress 不断重定向到 install-php

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9827164/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:54:34  来源:igfitidea点击:

Wordpress keeps redirecting to install-php after migration

wordpressmigrationinstallrelocation

提问by Hiilo

Here's my situation. I have followed the exact instructions on wordpress codex page about moving a site to another server. Here are the step's i have taken.

这是我的情况。我已按照 wordpress codex 页面上有关将站点移动到另一台服务器的确切说明进行操作。这是我采取的步骤。

  1. Export a copy of my database
  2. Make a new database in the new server
  3. Import the database I exported earlier
  4. Upload a copy of my Wordpress files via Ftp
  5. Use this scriptto change all my local url's to new one's
  6. Make changes to my wp-config.php file according to the new server(I did not forget table prefix. Although it has some uppercase characters in it )
  1. 导出我的数据库的副本
  2. 在新服务器上新建一个数据库
  3. 导入我之前导出的数据库
  4. 通过 Ftp 上传我的 Wordpress 文件的副本
  5. 使用此脚本将我所有的本地 url 更改为新的
  6. 根据新服务器更改我的 wp-config.php 文件(我没有忘记表前缀。虽然里面有一些大写字符)

And then when I try to open my site on the new location it just directs me to wp-admin/install.php Now just to make the scenario clearer: The destination folder(on live server) is a sub directori in a public_html folder which already has another wordpress install inside it(I'm saying this just in case it should matter)

然后当我尝试在新位置打开我的网站时,它只是将我定向到 wp-admin/install.php 现在只是为了使场景更清晰:目标文件夹(在实时服务器上)是 public_html 文件夹中的一个子目录里面已经安装了另一个 wordpress(我说这是为了以防万一)

My .htaccess looks like this

我的 .htaccess 看起来像这样

    # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subDirectoryName/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subDirectoryName/index.php [L]
</IfModule>

# END WordPress

I have tried checking and repairing my tables via phpMyadmin but everything seems to be ok there and has no effect on the problem.

我曾尝试通过 phpMyadmin 检查和修复我的表,但那里似乎一切正常,对问题没有影响。

I also tried emptying the database on the live server and go through with the install. And it installs with no problems and everything works fine but, well I have no use for another clean install. But I think this at least rules out any trouble with wp-config file. I'm using Wordpress Version 3.3.1

我还尝试清空实时服务器上的数据库并完成安装。它安装没有问题,一切正常,但是,我没有再进行一次全新安装。但我认为这至少排除了 wp-config 文件的任何问题。我正在使用 Wordpress 3.3.1 版

So I guess the big question I'm left with is: Why isn't wordpress recognizing my Install after migration?

所以我想我剩下的一个大问题是: 为什么 wordpress 在迁移后不识别我的安装?

Any help much appreciated!

非常感谢任何帮助!

回答by Hiilo

Well finally I have solved the problem. And surprise, surprise It was the freaking UPPERCASE letter in my table prefix. I had it this way in my wp-config file wp_C5n but for some reason most of the tables got a prefix wp_c5n. But not all. So what id did was I changed my table prefix in wp_config file to all lowercase and then went through all the tables by hand via phpMyadmin to see If there's any uppercase tables left. There where about 3. They were inside usermeta table and inside options table. Now finally everything is working. Did a quick search through wordpress codex but did not find anything mentioning not to use uppercase characters.

好吧,我终于解决了这个问题。惊喜,惊喜 这是我表前缀中的大写字母。我在我的 wp-config 文件 wp_C5n 中有这种方式,但由于某种原因,大多数表都有一个前缀 wp_c5n。但不是所有的。所以 id 所做的是我将 wp_config 文件中的表前缀更改为全部小写,然后通过 phpMyadmin 手动查看所有表,以查看是否还有大写的表。那里大约有 3 个。它们在 usermeta 表和 options 表中。现在终于一切正常。通过 wordpress codex 进行了快速搜索,但没有找到任何提到不使用大写字符的内容。

回答by WebPro

Resolved: wp-config.php setting

已解决:wp-config.php 设置

I had a similar problem. I got the install.php after moving files and creating a new database. It seems the install screen shows up it there is problem finding the correct database tables.

我有一个类似的问题。移动文件并创建新数据库后,我得到了 install.php。似乎安装屏幕显示找到正确的数据库表有问题。

I fixed the problem by changing the following settings to be correct:

我通过将以下设置更改为正确来解决此问题:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'HikeforLife_dev11');

/** MySQL database username */
define('DB_USER', 'HikeforLife_dev11');

$table_prefix  = 'wphk_';

回答by Beltran

I would check two things:

我会检查两件事:

  • First, I would check the url that is configured in the database. Check the wp_options table and the values of the "siteurl" and "home" options, it is possible that you need to update them if your domain has changed.

  • Another option is that your Apache server could not get the .htaccess. Check if the "AllowOverride" option is "all" in the httpd.conf file.

  • 首先,我会检查在数据库中配置的 url。检查 wp_options 表以及“siteurl”和“home”选项的值,如果您的域发生变化,您可能需要更新它们。

  • 另一种选择是您的 Apache 服务器无法获取 .htaccess。检查 httpd.conf 文件中的“AllowOverride”选项是否为“all”。

I hope it helps.

我希望它有帮助。

回答by funkylaundry

I experienced a similar issue. None of the suggestions above helped me, though.

我遇到了类似的问题。不过,上面的建议都没有帮助我。

Eventually I realized that the Wordpress MySQL-user on my production environment had not been assigned sufficient privileges.

最终我意识到我的生产环境中的 Wordpress MySQL 用户没有被分配足够的权限。

回答by chris.dempsey

I experienced the same issue as the OP - Wordpress keeps redirecting to install-php after migration.

我遇到了与 OP 相同的问题 - Wordpress 在迁移后不断重定向到 install-php。

Problem was my database tables are named as prefix_tablenameand I missed the underscore from $table_prefixin wp-config.

问题是我的数据库表被命名为 prefix_tablename,我错过了$table_prefixin 中的下划线wp-config

$table_prefix = 'myprefix';

$table_prefix = 'myprefix';

should have been

本来应该

$table_prefix = 'myprefix_';

$table_prefix = 'myprefix_';

回答by Martin Tonev

Don't forget also the table prefixes if you installation don't use the default prefix.

如果您的安装不使用默认前缀,也不要忘记表前缀。

回答by Ran

As I was trying to install server setup to localhost, I have configured the config file as well as DB in local host- I was redirected to the install.php.

当我尝试将服务器设置安装到本地主机时,我已经在本地主机中配置了配置文件和数据库 - 我被重定向到 install.php。

wp

湿疹

Check:1 Go to yourTableName_options Move to 'option_id'- '1'Change 'yousite url'to 'localhost/youLocalSiteFolderName'

检查:1 转到 yourTableName_options Move to 'option_id'- '1' 将'yousite url'更改为'localhost/youLocalSiteFolderName'

Move to 'option_id' - '37'Change homw value to 'localhost/youLocalSiteFolderName'

移至'option_id' - '37' 将homw 值更改为'localhost/youLocalSiteFolderName'

Check:2 Move to 'wp_config' file check : $table_prefix = 'yourNew_Prefix_';

检查:2 移至 'wp_config' 文件检查:$table_prefix = ' yourNew_Prefix_';

Hope it will help

希望它会有所帮助

回答by Spacer

I had the same problem and I fixed it by changing the database user privileges to full read & write.

我遇到了同样的问题,我通过将数据库用户权限更改为完全读写来修复它。

回答by racl101

This happened to me after I copy migrated an existing website to WP Engine and forgot to do one thing required by WP Engine:

在我将现有网站复制迁移到 WP Engine 并忘记执行 WP Engine 要求的一件事后,这发生在我身上:

Update the WordPress core installation of the site that is being copied to the latest version.

更新正在复制到最新版本的站点的 WordPress 核心安装

So here was the problem then:

那么问题来了:

My old site that I was copying from another server to WP Engine had version 4.0. However, when you copy an existing site to WP Engine, you don't copy the WordPress core files, you only copy the contents of wp-contentand the state (or snapshot) of the existing database. So the state of the database for my existing site was for an installation running WP 4.0. Nevertheless, when you create a new WordPress install on WP Engine, that install is created with the latest version of WordPress, which, at the time happened to be version 4.0.1, so that means the core files on the destination (WP Engine) were for a 4.0.1 installation but the database snapshot I was gonna import into WP Engine was for version 4.0. So when I overwrote the default WP Engine database with the import of the copy the database of my old site, I got the redirection error to the install script.

我从另一台服务器复制到 WP Engine 的旧站点的版本为 4.0。但是,当您将现有站点复制到 WP Engine 时,您不会复制 WordPress 核心文件,而只会复制wp-content现有数据库的内容和状态(或快照)。因此,我现有站点的数据库状态适用于运行 WP 4.0 的安装。然而,当您在 WP 引擎上创建新的 WordPress 安装时,该安装是使用最新版本的 WordPress 创建的,当时版本是 4.0.1,因此这意味着目标(WP 引擎)上的核心文件用于 4.0.1 安装,但我要导入 WP Engine 的数据库快照适用于 4.0 版. 因此,当我通过导入旧站点的数据库副本来覆盖默认的 WP Engine 数据库时,我收到了到安装脚本的重定向错误。

So to fix it, I just logged into the WordPress admin site of the site on WP Engine, made sure to reset the file permissions (by clicking the blue button), which, you sometimes have to do on WP Engine, and then re-installed the WordPress core, which, basically updates your database so that internally the db state was for a WordPress 4.0.1 install and the core files also match the version.

因此,为了修复它,我刚刚在 WP Engine 上登录该站点的 WordPress 管理站点,确保重置文件权限(通过单击蓝色按钮),您有时必须在 WP Engine 上执行此操作,然后重新 -安装了 WordPress 核心,它基本上更新了您的数据库,以便在内部 db 状态用于 WordPress 4.0.1 安装,并且核心文件也与版本匹配。

Took me a while to figure out what was going on.

我花了一段时间才弄清楚发生了什么。

回答by Alexandre le Grand

I experienced this issue today and started searching on internet. In my case there was no table in my DB. I forgot to import the tables on the online server. I did it and all works fine.

我今天遇到了这个问题并开始在互联网上搜索。就我而言,我的数据库中没有表。我忘了导入在线服务器上的表。我做到了,一切正常。