運用中のWordPressで構築したサイトがあるのですが、
かなり前に借りたサーバで運用しているので、
只今新しいサーバを用意して移管作業中です。
その際、
PHPのバージョンがPHP5.3.xからPHP7.1.xに変更になった影響で、
以下のようなエラーが出ました。
Warning: Illegal string offset 'remember' in /xxxx/xxxx/wp-includes/user.php on line 41
Warning: Cannot assign an empty string to a string offset in /xxxx/xxxx/wp-includes/user.php on line 41
Warning: Illegal string offset 'user_login' in /xxxx/xxxx/wp-includes/user.php on line 56
Fatal error: Uncaught Error: Cannot create references to/from string offsets in /xxxx/xxxx/wp-includes/user.php:56 Stack trace: #0 /xxxx/xxxx/wp-login.php(784): wp_signon('', '') #1 {main} thrown in /xxxx/xxxx/wp-includes/user.php on line 56
早速、
Googleで調べてみると情報は直ぐに出てきました。
取りあえず、
検索で一番最初に出てきたので以下のページを確認です。
https://core.trac.wordpress.org/ticket/37071
英語サイトですが、
簡単に情報をまとめられていたので、
今回はこのまま参考にさせて頂きました。
修正方法は、
「wp-login.php」
を開いて
$user = wp_signon( '', $secure_cookie );
のコードを削除して、
$user = wp_signon( array(), $secure_cookie );
に変更すればいいとのこと。
この通りに修正すれば、
問題なく表示されるようになりました。
この記事へのコメントはありません。