You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = []) in /Users/len/Sites/dev.bookdiscovery.mamp/wp-content/composer/vendor/monolog/monolog/src/Monolog/Logger.php on line 681
Steps to reproduce
Install typesense-php with composer
use Typesense/Client
$client = new Client()
Expected Behavior
No errors
Actual Behavior
Fatal error
Metadata
**PHP Version: 8.1
Typesense Version: 26
OS: Ubuntu 24.01
The text was updated successfully, but these errors were encountered:
The problem turned out to be related to the versions of monolog and psr installed by composer. Apparently there is an issue with monolog 3+. These threads were helpful in diagnosing:
The solution was to downgrade monolog and psr. I accomplished this by adding the following lines to the composer.json file in the project root:
"monolog/monolog": "^2.5", "psr/log": "^2.0"
I then updated monolog and psr with the following composer command (composer required simultaneous update of monolog and psr for this operation):
composer update monolog/monolog psr/log
This operation successfully downgraded monolog from version 3.6.0 to version 2.9.3 and psr from version 3.0.0 to version 2.0.0. The TypeSense PHP client is now working.
laflier
changed the title
PHP Fatal Error
PHP Fatal Error Monolog/PSR Version Incompatibility
May 11, 2024
Description
PHP Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = []) in /Users/len/Sites/dev.bookdiscovery.mamp/wp-content/composer/vendor/monolog/monolog/src/Monolog/Logger.php on line 681
Steps to reproduce
Install typesense-php with composer
use Typesense/Client
$client = new Client()
Expected Behavior
No errors
Actual Behavior
Fatal error
Metadata
**PHP Version: 8.1
Typesense Version: 26
OS: Ubuntu 24.01
The text was updated successfully, but these errors were encountered: