読者です 読者をやめる 読者になる 読者になる

php5.5とwordpress3.xでerrorが吐かれる

php5.5 環境でwordpressを起動するとエラーが発生するため対応のメモ

  • wordpress 4.1(2015/1/2時点で最新)では発生しない
  • wordpress 3.1.4 では発生

原因

発生エラーログ /var/log/httpd/error_log

[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/user.php on line 657, referer: http://192.168.33.10/
[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/user.php on line 657, referer: http://192.168.33.10/
[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/user.php on line 657, referer: http://192.168.33.10/
[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/class-wp-admin-bar.php on line 167, referer: http://192.168.33.10/
[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/class-wp-admin-bar.php on line 167, referer: http://192.168.33.10/
[:error] [pid 25610] [client 192.168.33.1:49316] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-includes/class-wp-admin-bar.php on line 167, referer: http://192.168.33.10/
[:error] [pid 25599] [client 192.168.33.1:52294] 
PHP Warning:  Creating default object from empty value in /var/www/html/test2/wordpress/wp-admin/includes/post.php on line 421, referer: http://192.168.33.10/wp-admin/edit.php

対応

環境 Vagrant / Centos7 / php5.5 / MySQL5.6 (MariaDBは利用せず)