简体   繁体   English

将 WordPress 从 Live 迁移到本地主机

[英]Moving WordPress from Live to Localhost

I am attempting to move a live website to a localhost for testing purposes and I cannot get the website to load.我正在尝试将实时网站移动到本地主机以进行测试,但无法加载该网站。 When I go to localhost:8888/example my browser loads the page indefinitely and displays only a blank white page.当我转到 localhost:8888/example 时,我的浏览器无限期地加载页面并且只显示一个空白页面。

The steps I've taken to migrate from live to local are from this tutorial我从实时迁移到本地所采取的步骤来自本教程

  1. Install free version of MAMP安装免费版 MAMP
  2. Import my live database using phpMyAdmin on MAMP在 MAMP 上使用 phpMyAdmin 导入我的实时数据库
  3. Change all instances of http://www.example.com to http://localhost:8888/example using this tool使用此工具http://www.example.com 的所有实例更改为http://localhost:8888/example
  4. Install WordPress in my local website's directory called 'example'在我本地网站的名为“example”的目录中安装 WordPress
  5. Copy over wp-content and wp-config.php to 'example'将 wp-content 和 wp-config.php 复制到“example”
  6. Configure wp-config.php with配置 wp-config.php

    define('DB_NAME', 'myDatabase'); define('DB_USER', 'myUserName'); define('DB_PASSWORD', 'myPassword'); define('DB_HOST', 'localhost:8888');

  7. Navigate to localhost:8888/example导航到 localhost:8888/example

Then, nothing happens.然后,什么也没有发生。

Here are the results of apache_error.log这是apache_error.log的结果

[Wed Jul 25 08:08:14 2018] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 25 08:08:14 2018] [notice] Digest: done
[Wed Jul 25 08:08:14 2018] [notice] FastCGI: process manager initialized (pid 14761)
[Wed Jul 25 08:08:14 2018] [notice] Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.1 mod_ssl/2.2.34 OpenSSL/1.0.2j DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.24.0 configured -- resuming normal operations
[Wed Jul 25 08:13:48 2018] [notice] caught SIGTERM, shutting down
[Wed Jul 25 08:13:56 2018] [notice] Digest: generating secret for digest authentication ...
[Wed Jul 25 08:13:56 2018] [notice] Digest: done
[Wed Jul 25 08:13:56 2018] [notice] FastCGI: process manager initialized (pid 15305)
[Wed Jul 25 08:13:56 2018] [notice] Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.1 mod_ssl/2.2.34 OpenSSL/1.0.2j DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.24.0 configured -- resuming normal operations

... and the results of php_error.log ...以及 php_error.log 的结果

[25-Jul-2018 15:10:59 Europe/London] PHP Notice:  icit_srdb::recursive_unserialize_replace(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Requests_Utility_CaseInsensitiveDictionary" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Applications/MAMP/htdocs/far/srdb.class.php on line 755
[25-Jul-2018 15:10:59 Europe/London] PHP Notice:  icit_srdb::recursive_unserialize_replace(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Requests_Utility_CaseInsensitiveDictionary" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Applications/MAMP/htdocs/far/srdb.class.php on line 755
[25-Jul-2018 15:10:59 Europe/London] PHP Notice:  icit_srdb::recursive_unserialize_replace(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Requests_Utility_CaseInsensitiveDictionary" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Applications/MAMP/htdocs/far/srdb.class.php on line 755
[25-Jul-2018 15:10:59 Europe/London] PHP Notice:  icit_srdb::recursive_unserialize_replace(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Requests_Utility_CaseInsensitiveDictionary" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Applications/MAMP/htdocs/far/srdb.class.php on line 755
[25-Jul-2018 15:10:59 Europe/London] PHP Notice:  icit_srdb::recursive_unserialize_replace(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Requests_Utility_CaseInsensitiveDictionary" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /Applications/MAMP/htdocs/far/srdb.class.php on line 755
[25-Jul-2018 14:12:35 UTC] PHP Warning:  require_once(/Applications/MAMP/htdocs/example/gd-config.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/example/wp-config.php on line 84
[25-Jul-2018 14:12:35 UTC] PHP Fatal error:  require_once(): Failed opening required '/Applications/MAMP/htdocs/example/gd-config.php' (include_path='.:/Applications/MAMP/bin/php/php7.2.1/lib/php') in /Applications/MAMP/htdocs/example/wp-config.php on line 84

Easiest way to migrate WP from localhost to live and vice versa is with plugin将 WP 从本地主机迁移到实时迁移(反之亦然)的最简单方法是使用插件

https://wordpress.org/plugins/all-in-one-wp-migration/ https://wordpress.org/plugins/all-in-one-wp-migration/

You export everything, create local version of WP, install plugin and then import prevoiously exported wpress file from live page with this plugin, then when you are done, confirm permalinks twice and that should be it您导出所有内容,创建 WP 的本地版本,安装插件,然后使用此插件从实时页面导入先前导出的 wpress 文件,然后当您完成后,确认永久链接两次,就是这样

It will migrate your code as well as your db它将迁移您的代码以及您的数据库

You can also use "Duplicator Plugin".您也可以使用“复制器插件”。 It's very easy and fast.这非常容易和快速。

Please see the below link... https://wordpress.org/plugins/duplicator/请参阅以下链接... https://wordpress.org/plugins/duplicator/

I solved the problem by following janmyszkier instructions.我按照janmyszkier说明解决了这个问题。 First, I added gd-config.php to the correct directory.首先,我将 gd-config.php 添加到正确的目录中。 Second, I corrected the browser error SSL_ERROR_RX_RECORD_TOO_LONG by following these instructions .其次,我按照这些说明纠正了浏览器错误 SSL_ERROR_RX_RECORD_TOO_LONG。

UPDATE: This got my site up and running locally but the solution to the SSL error limited to no JavaScript functionality, as it created a non-secure SHA-1 certificate.更新:这让我的网站在本地启动并运行,但解决 SSL 错误的方法仅限于没有 JavaScript 功能,因为它创建了一个不安全的 SHA-1 证书。

I fixed SSL_ERROR_RX_RECORD_TOO_LONG.我修复了 SSL_ERROR_RX_RECORD_TOO_LONG。

UPDATE wp_tnxo_options SET option_value = replace(option_value, ' http://westerp7.local ', ' http://localhost:81/westerp7 ') WHERE option_name = 'home' OR option_name = 'siteurl';更新 wp_tnxo_options SET option_value = replace(option_value, ' http://westerp7.local ', ' http://localhost:81/westerp7 ') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_tnxo_posts SET post_content = replace(post_content, ' http://westerp7.local ', ' http://localhost:81/westerp7 ');更新 wp_tnxo_posts SET post_content = replace(post_content, ' http://westerp7.local ', ' http://localhost:81/westerp7 '); UPDATE wp_tnxo_postmeta SET meta_value = replace(meta_value,' http://westerp7.local ',' http://localhost:81/westerp7 ');更新 wp_tnxo_postmeta SET meta_value = replace(meta_value,' http://westerp7.local ',' http://localhost:81/westerp7 ');

Then from here:然后从这里:

Secure, https When Live, Website Will Not Open Copy in XAMPP as http 安全,https 上线时,网站不会在 XAMPP 中打开复制为 http

Add this code to your config-wp.php file:将此代码添加到您的 config-wp.php 文件中:

define('FORCE_SSL', false);定义('FORCE_SSL',假); define('FORCE_SSL_ADMIN', false);定义('FORCE_SSL_ADMIN',假);

define('WP_HOME',' http://localhost/sitename ');定义('WP_HOME',' http://localhost/sitename '); define('WP_SITEURL',' http://localhost/sitename ');定义('WP_SITEURL',' http://localhost/sitename ');

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

相关问题 将WordPress网站从实时移动到本地主机后出现404错误和重定向 - 404 error and redirect after moving wordpress site from live to localhost 使用GoDaddy cPanel将Wordpress网站从本地主机移动到实时服务器 - Moving wordpress site from localhost to live server using GoDaddy cPanel 将站点从本地主机移动到实时服务器时出现 Wordpress 错误 - Wordpress error while moving site from localhost to live server 将wordpress从服务器移动到localhost - Moving wordpress from server to localhost 从localhost wordpress更改为实时站点wordpress - changes from localhost wordpress to live site wordpress 将Wordpress网站从托管移至本地主机进行开发 - Moving wordpress site from hosting to localhost for development 将我的Codeigniter站点从实时服务器移动到本地主机时出现问题 - Problem in moving my Codeigniter site from live server to localhost 移动Joomla后出现错误! 网站从本地主机到实时服务器 - Errors after moving Joomla! website to live server from localhost Wordpress 仪表板:将实时网站移动到本地主机后,“抱歉,您不允许访问此页面” - Wordpress dashboard : "Sorry you are not allowed to access this page" after moving live website to localhost 将 wordpress 站点从本地主机迁移到实时服务器的最简单方法是什么 - what is the easiest way to migrate wordpress site from localhost to live server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM