Remove `WP_DEBUG_DISPLAY` => `false` once WordPress works well with PHP 8.1
leoloso opened this issue · comments
Leonardo Losoviz commented
After requiring PHP 8.1 for DEV (#1497), the Lando webserver with WordPress installed started showing deprecations:
Deprecated: setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated in /app/wordpress/wp-includes/option.php on line 1110
Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /app/wordpress/wp-includes/formatting.php on line 2761
That's because WordPress is not yet fully compatible with PHP 8.1. These deprecation messages are annoying, and they prevent the GraphQL server from working, since these messages are also included in the JSON response, thus breaking it.
As a temporary solution, the messages are hidden by adding to wp-config.php
:
define( 'WP_DEBUG_DISPLAY', false );
Once WordPress is fully compatible with PHP 8.1, remove this code. For that, search and delete all occurrences of WP_DEBUG_DISPLAY
everywhere.