Home>

When a WordPress site managed by XSERVER is migrated to AWS, it can no longer be entered into the administration screen.
The domain is also changing.
The management screen is located at /wp-login.php.

Target domain: nakazawakan.com
∟ Server: xserver
∟ Domain: Your name.com

Destination domain: sample-program.xyz
∟Server: AWS
∟Domain: xdomain

After moving the WordPress site, the lower page was not displayed.
Due to the work done below, the lower page is now displayed.
However, it is not in the management screen.

The error details are summarized in 1 and the work done is summarized in 2.

1. Error details

Displayed screen, web server error log

1-1. [About sample-progra.xyz/wp-login.php screen]

The following is displayed.

1-2.Error log

If i check with Linux, the following will be displayed.

[root @ ip-10-0-1-10 httpd] # tail -f error_log
[Wed Nov 20 18: 11: 19.198109 2019] [so: warn] [pid 3789] AH01574: module rewrite_module is already loaded, skipping
[Wed Nov 20 18: 11: 19.200736 2019] [lbmethod_heartbeat: notice] [pid 3789] AH02282: No slotmem from mod_heartmonitor
[Wed Nov 20 18: 11: 19.200769 2019] [http2: warn] [pid 3789] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. has more demands in this regard and the currently selected mpm will just not do.This is an advisory warning.Your server will continue to work, but the HTTP/2 protocol will be in active.
[Wed Nov 20 18: 11: 19.200775 2019] [http2: warn] [pid 3789] AH02951: mod_ssl does not seem to be enabled
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: mysqlnd_global_stats) , /usr/lib64/php/modules/mysqli.so.so (/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0PHP Warning: Module 'mbstring' already loaded in Unknown on line 0
[Wed Nov 20 18: 11: 19.222266 2019] [mpm_prefork: notice] [pid 3789] AH00163: Apache/2.4.41 () PHP/7.2.24 configured-resuming normal operations
[Wed Nov 20 18: 11: 19.222288 2019] [core: notice] [pid 3789] AH00094: Command line: '/ usr/sbin/httpd -D FOREGROUND'
[Wed Nov 20 23: 55: 12.760725 2019] [php7: warn] [pid 3836] [client 93.174.93.114:26425] PHP Warning: require_once (./ scribing/phpQuery-onefile.php): failed to open stream: No such file or directory in /var/www/html/test.php on line 3
[Wed Nov 20 23: 55: 12.760785 2019] [php7: error] [pid 3836] [client 93.174.93.114:26425] PHP Fatal error: require_once (): Failed opening required './scribing/phpQuery-onefile.php' (include_path = '.:/usr/share/pear:/usr/share/php') in /var/www/html/test.php on line 3
1-3. Debug mode

define ('WP_DEBUG', true);
After changing the above, the following error is displayed on the top page.
Therefore, we removed the plugin for accelerated-mobile-page.

Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
Notice: Undefined index: ampforwp-homepage-on-off-support in /var/www/html/wp-content/plugins/accelerated-mobile-pages/templates/features.php on line 5577
2.Try it 2-1. httpd.conf edit

sudo vim /etc/httpd/conf/httpd.conf

Before change: AllowOverride None
After change: AllowOverride All


LoadModule rewrite_module modules/mod_rewrite.so

2-2. Add .htaccess file to/var/www/html

/var/www/html/.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>RewriteEngine On
RewriteBase/cd
RewriteRule ^ index \ .php $-[L]
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_FILENAME}! -D
RewriteRule. /Index.php [L]
</IfModule>
# END WordPress
2-3. Add code to wp-config.php

/var/www/html/wp-config.php

define ('WP_SITEURL', 'https: //sample-program.xyz/');
define ('WP_HOME', 'https: //sample-program.xyz/');
2-4. Database and file path correction

UPDATE wp_options SET option_value = REPLACE (option_value, "nakazawakan.com", "sample-program.xyz");
UPDATE wp_posts SET post_content = REPLACE (post_content, "nakazawakan.com", "sample-program.xyz");
UPDATE wp_posts SET guid = REPLACE (guid, "nakazawakan.com", "sample-program.xyz");
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, "nakazawakan.com", "sample-program.xyz");


grep -l 'nakazawakan.com' all files | xargs sed -i.bak -e 's/nakazawakan.com/sample-program.xyz/g'

2-5. Grant
sudo chown ec2-user.ec2-user -R/var/www/html
sudo chmod + w -R/var/www/html
sudo systemctl restart httpd
  • Answer # 1

    There was a description "Cause of redirect loop", so it was fixed after adding the following code to wp-config.php!

    sudo vim /var/www/html/wp-config.php
    $_SERVER ['HTTPS'] = 'on';
    $_ENV ['HTTPS'] = 'on';

    I just got another plug-in error, but
    Thank you for everything!