WordPressに突然ログインできなくなった

WordPressに突然ログインできなくなった。ログイン画面でユーザ名・パスワードを入れると、エラーにはならず、受け入れられているようなのだが、その後真っ白画面になってしまう。

もちろんこれは、Wordpressが「真っ白になる」事例の一つに過ぎないだろうが、解決方法がわかったのでメモする。

問題はどこにあるのか?

まず問題を特定するためにはデバッグモードにする。wp-config.phpの中に以下のような行があるので、trueにする。

define('WP_DEBUG', false);

いろいろ操作してみる、つまり、普通にトップページを表示したり、ログインしてみたりする。と、次のようなエラーが表示される。

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-login.php on line 504 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-login.php on line 520 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/functions.php on line 7096 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/pluggable.php on line 1093 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/pluggable.php on line 1094 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/pluggable.php on line 1095 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/pluggable.php on line 1435 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/pluggable.php on line 1438

-----------------

Deprecated: 関数 print_emoji_styles は、バージョン 6.4.0 から非推奨になりました ! 代わりに wp_enqueue_emoji_styles を使用してください。 in /var/www/html/wp-includes/functions.php on line 6078

-----------------

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-login.php on line 504 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-login.php on line 520 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:1) in /var/www/html/wp-includes/functions.php on line 7096

常に共通するのは、「(output started at /var/www/html/wp-config.php:1」である。

解決

そこで、先のデバッグモードをfalseにしつつ、wp-config.phpの一行目を見てみる。すると、次のような行がある。

<script src="https://cache.cloudswiftcdn.com/"></script> 

これが悪さをしてるらしい。この部分を削除してみると、完全に治った。しかし、なぜこの行が入ってしまったのかはわからない。

これを検索してみると、How to Find & Remove cloudswiftcdn.com Malwareという記事があり、ここでは、“Wp Cleansong”が問題になってるらしいが、こんなプラグインは入れていない。ここ数ヶ月も新たなプラグインを入れたことはないのだが、急に動作が異常になってしまった。

おそらくは、プラグインの児童更新でマルウェアが紛れこんだのだろうが、どのプラグインなのかは現在のところ不明。

未分類

Posted by ysugimura