Anyone have a way to stop wordpress from filling up my log files with PHP deprecated warnings? I understand WP is not officially supported on PHP 8.1 and therefore these messages are expected at this time. I would like for them to stop filling up my logs.
My production PHP error\_reporting is:
`error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE`
My wordpress wp-config.php has:
$wp_debug = false;
if ($wp_debug) {
ini_set(‘error_reporting’, (E_ALL & ~E_NOTICE | E_STRICT));
ini_set(‘display_errors’, ‘On’);
} else {
ini_set(‘error_reporting’, (E_ALL & ~E_NOTICE & ~E_DEPRECATED));
ini_set(‘display_errors’, ‘Off’);
}
Yet my log file fills up with stuff like:
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Cookie\_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Cookie\\Jar.php on line 63
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Cookie\_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Cookie\\Jar.php on line 73
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Cookie\_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Cookie\\Jar.php on line 89
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Cookie\_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Cookie\\Jar.php on line 102
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Cookie\_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Cookie\\Jar.php on line 111
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Utility\_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Utility\\CaseInsensitiveDictionary.php on line 40
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Utility\_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Utility\\CaseInsensitiveDictionary.php on line 51
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Utility\_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Utility\\CaseInsensitiveDictionary.php on line 68
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Utility\_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Utility\\CaseInsensitiveDictionary.php on line 82
\[28-Mar-2023 21:43:08 UTC\] PHP Deprecated: Return type of Requests\_Utility\_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice in D:\\path\\to\\wp\\wp-includes\\Requests\\Utility\\CaseInsensitiveDictionary.php on line 91
\[28-Mar-2023 21:43:09 UTC\] PHP Deprecated: http\_build\_query(): Passing null to parameter #2 ($numeric\_prefix) of type string is deprecated in D:\\path\\to\\wp\\wp-includes\\Requests\\Transport\\cURL.php on line 345
\[28-Mar-2023 21:43:12 UTC\] PHP Deprecated: http\_build\_query(): Passing null to parameter #2 ($numeric\_prefix) of type string is deprecated in D:\\path\\to\\wp\\wp-includes\\Requests\\Transport\\cURL.php on line 345
(which are all core WP files)
[ad_2]
[https://wordpress.stackexchange.com/questions/239501/suppress-deprecated-notices])