I was trying to setup a local environment of a website created on Acquia cloud platform. Everything was done properly including the database import. But now, when I execute drush commands, it gives me the following error.
PHP Fatal error: Declaration of Drush\Application::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void in C:\xampp\htdocs\pk-new\vendor\psr\log\Psr\Log\LoggerAwareTrait.php on line 22
I tried to rectify this by finding a solution online. The solution I found was to include :void in the function definition of the file throwing the error. After saving this, when I tried to run the drush commands it threw another error.
This time it was related to the $message variable not being compatible in two files. I tried to find the solution to this but then after fixing that it threw another error of the same type. I believe there is a right way to fix this without playing with the core files.
Is this a problem related to drush being globally installed? I am not too sure of that and also on how to go about it if that is the case.
I had done this type of an export in the past and it worked just fine, but now it is not. I feel that the compatibility of drush and php version might be causing problems.
The version I have are:
Drush - 11.4.0
PHP 8.1.14
Please let me know if there is a way to fix this issue. And if not, whether this issue will create problems while working on the website in the future.
Thank you!