WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 8 weeks ago

#52825 new defect (bug)

[PHP 8.1] MySQLi error reporting value changes

Reported by: ayeshrajans Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Database Keywords: php81 has-patch
Focuses: Cc:

Description

I suppose this is the first ticket for PHP 8.1 - Exciting :)

In PHP 8.1, the default error reporting is set to always throw an exception, as opposed to emitting a warning. WordPress gracefully handles the database errors by inspecting the error codes.

I suggest that WordPress set the error reporting mode to off, which is the default value prior to this change. Unless we do this, any bad MySQLi connection will throw an exception, leading to a WSOD, or a blank page with the uncaught exception error.

(linking to a PR)

Change History (1)

This ticket was mentioned in PR #1099 on WordPress/wordpress-develop by Ayesh.


8 weeks ago

In PHP 8.1, the default error reporting is set to always throw an exception, as opposed to emitting a warning. WordPress gracefully handles the database errors by inspecting the error codes.

I suggest that WordPress set the error reporting mode to off, which is the default value prior to this change. Unless we do this, any bad MySQLi connection will throw an exception, leading to a WSOD, or a blank page with the uncaught exception error.

Trac ticket: https://core.trac.wordpress.org/ticket/52825

Note: See TracTickets for help on using tickets.