Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#45683 new defect (bug)

WP 5.0.1 Throwing Warning on site when running PHP 7.1

Reported by: wendy_d's profile Wendy__D Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0.1
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

Visible warning appears when running 5.0.1 on PHP 7.1

"Warning: array_merge(): Argument #2 is not an array in /[redacted]/wp-includes/load.php on line 63" error appeared on front end after autoupdate to 5.0.1.
Error persistent on both themes twenty nineteen and twenty seventeen (although hidden behind the main image) with every plugin deactivated, and 5.0.1 freshly reinstalled. When I changed PHP version to 7.2 the error went away. Back to 7.1.25 it reappeared.

Change History (1)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Bootstrap/Load

Hi there, welcome to WordPress Trac! Thanks for the report.

The warning comes from this line in wp_fix_server_vars():

$_SERVER = array_merge( $default_server_values, $_SERVER );

The line was added 9 years ago in [13812] for WordPress 3.0, and has not changed since then.

A quick search shows a blog post on the issue and a few posts on support forums. Some of the reports mention SiteGround hosting, and that renaming or removing the php.ini file in the site's root directory fixes the issue.

That doesn't provide enough details yet, but apparently the issue happens if some security settings in
particular PHP configurations override or restrict access to the $_SERVER global variable.

Note: See TracTickets for help on using tickets.