Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP 8.1] MySQLi error reporting value changes #1099

Closed
wants to merge 1 commit into from

Conversation

Ayesh
Copy link

@Ayesh Ayesh commented Mar 16, 2021

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

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.

 - [PHP 8.1: MySQLi: Default error mode set to exceptions](https://php.watch/versions/8.1/mysqli-error-mode)
 - [RFC](https://wiki.php.net/rfc/mysqli_default_errmode)

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
@SergeyBiryukov
Copy link
Member

Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51582.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants