[英]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我从实时迁移到本地所采取的步骤来自本教程
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');
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.