When I run any drush command or even just drush I get the fatal error:
Fatal error: Declaration of Drupal\Core\Logger\LoggerChannel::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerTrait::log($level, Stringable|string $message, array $context = []): void in /core/lib/Drupal/Core/Logger/LoggerChannel.php on line 94
I updated drupal with composer to 9.5 and I'm running PHP 8.1. Here is my composer.json requirements:
"require": {
"composer/installers": "^1.9",
"drupal/bootstrap": "^3.24",
"drupal/captcha": "^1.2",
"drupal/core-composer-scaffold": "^9.0.0",
"drupal/core-project-message": "^9.0.0",
"drupal/core-recommended": "^9.5",
"drupal/core-vendor-hardening": "^8.8",
"drupal/feeds": "^3.0@beta",
"drupal/feeds_ex": "^1.0@alpha",
"drupal/field_formatter": "^3.0@RC",
"drupal/google_tag": "^1.5",
"drupal/gtranslate": "^1.14",
"drupal/honeypot": "^2.0",
"drupal/image_popup": "^2.0",
"drupal/mailsystem": "^4.3",
"drupal/masquerade": "^2.0@RC",
"drupal/menu_block": "^1.8",
"drupal/metatag": "^1.19",
"drupal/page_manager": "^4.0@beta",
"drupal/paragraphs": "^1.13",
"drupal/pathauto": "^1.9",
"drupal/recaptcha": "^3.0",
"drupal/recaptcha_element": "^1.0",
"drupal/redirect": "^1.7",
"drupal/schema_metatag": "^2.3",
"drupal/sendgrid_integration": "^2.0@beta",
"drupal/smtp": "^1.0",
"drupal/twig_tweak": "^3.1",
"drupal/views_bootstrap": "^4.3",
"drupal/webform": "^6.1",
"drupal/webform_spam_words": "^2.0",
"drupal/webform_validation": "^2.0@alpha",
"drupal/yoast_seo": "^2.0@alpha",
"drush/drush": "^11.4",
"google/recaptcha": "^1.2"
},
Here are the plugins:
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"drupal/core-vendor-hardening": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
I can't run any drush command and I get the following error if I go to my site:
Fatal error: Declaration of Drupal\dblog\Logger\DbLog::emergency($message, array $context = []) must be compatible with Psr\Log\LoggerInterface::emergency(Stringable|string $message, array $context = []): void in /core/lib/Drupal/Core/Logger/RfcLoggerTrait.php on line 20
Any suggestions on how to proceed?
EDIT* Additional Info:
PHP Version: 8.1.13
Drupal Core installed packages (from composer show -i
):
drupal/core 9.5.0
drupal/core-composer-scaffold 9.4.9
drupal/core-dev 9.4.9
drupal/core-project-message 9.4.9
drupal/core-recommended 9.5.0
drupal/core-vendor-hardening 8.9.20