PHP7.2でWordPressの管理ページにアクセスできない


PHPのバージョン5から7.2にしてWordPress(4.2.23)の管理ページにアクセスしたら、下記エラーが表示されログインできず。

Warning: Illegal string offset 'remember' in xxxxx/wp-includes/user.php on line 39

Warning: Cannot assign an empty string to a string offset in xxxxx/wp-includes/user.php on line 39

Warning: Illegal string offset 'user_login' in xxxxx/wp-includes/user.php on line 54

Fatal error: Uncaught Error: Cannot create references to/from string offsets in xxxxx/wp-includes/user.php:54 Stack trace: #0 xxxxx/wp-login.php(795): wp_signon('', '') #1 xxxxx/xxxxx.php(3): require_once('xxxxx...') #2 {main} thrown in xxxxx/wp-includes/user.php on line 54

wp-login.phpを修正。

% vi wp-login.php

$user = wp_signon( '', $secure_cookie );
↓変更
$user = wp_signon( array(), $secure_cookie );

WordPressのバージョンが古いので、
管理ページにログインしたら、すぐに5.2にバージョンアップしました。

参考

#37071 (PHP 7.1.0 changed how they handle string vs array-indexes.) – WordPress Trac

  • このエントリーをはてなブックマークに追加

コメントをどうぞ

メールアドレスが公開されることはありません。