0

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.

The steps I've taken to migrate from live to local are from this tutorial

  1. Install free version of MAMP
  2. Import my live database using phpMyAdmin on MAMP
  3. Change all instances of http://www.example.com to http://localhost:8888/example using this tool
  4. Install WordPress in my local website's directory called 'example'
  5. Copy over wp-content and wp-config.php to 'example'
  6. Configure wp-config.php with

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

  7. Navigate to localhost:8888/example

Then, nothing happens.

Here are the results of 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

[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
Seeth
  • 73
  • 10
  • you might have to modify RewriteBase of .htaccess to `/example` if that doesn't help please check MAMP apache logs, they will show you something PHP doesn't – Jan Myszkier Jul 25 '18 at 13:18
  • Unfortunately, it didn't work. Although, RewriteBase was listed as a hyphenated version of the _actual_ name of my website, so I removed the hyphen. Interesting... – Seeth Jul 25 '18 at 13:46
  • what are the MAMP logs saying now? please include them in the question – Jan Myszkier Jul 25 '18 at 13:47
  • Just added them above. – Seeth Jul 25 '18 at 14:17
  • you should also have the PHP log somewhere, please add them as well – Jan Myszkier Jul 25 '18 at 14:28
  • I couldn't add the entire log because it was about 100,000 lines too big, so I just added the last few errors. Do you need more? – Seeth Jul 25 '18 at 14:35
  • no, you have it there, missing file which is required by the script, please download it again from the server, FTP sometimes has those issues and forgets some files. – Jan Myszkier Jul 25 '18 at 14:36
  • Do you mean gd-config.php? I added it and receive a "Secure Connection Failed" error, while trying to load the website. Is this because my live site has SSL enabled and the incorrect settings were tranferred to the local-host? – Seeth Jul 25 '18 at 14:45
  • it's possible your local wordpress config (wp_options table) points to `https://` address and you don't have SSL installed (correctly or at all) locally, that's why browser says that secure connection failed. the simplest solution is to point it to `http://` protocol locally within the `wp_options` table – Jan Myszkier Jul 25 '18 at 14:48

4 Answers4

1

Easiest way to migrate WP from localhost to live and vice versa is with plugin

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

It will migrate your code as well as your db

Armin
  • 373
  • 2
  • 13
0

You can also use "Duplicator Plugin". It's very easy and fast.

Please see the below link... https://wordpress.org/plugins/duplicator/

0

I solved the problem by following janmyszkier instructions. First, I added gd-config.php to the correct directory. Second, I corrected the browser error SSL_ERROR_RX_RECORD_TOO_LONG by following these instructions.

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.

Seeth
  • 73
  • 10
0

I fixed 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'; UPDATE 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');

Then from here:

Secure, https When Live, Website Will Not Open Copy in XAMPP as http

Add this code to your config-wp.php file:

define('FORCE_SSL', false); define('FORCE_SSL_ADMIN', false);

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