monolog icon indicating copy to clipboard operation
monolog copied to clipboard

Uncaught Error: Class "Monolog\Logger" not found

Open Justman100 opened this issue 5 months ago • 7 comments

Hi, if i use Composer, this comes:

PHP Fatal error: Uncaught Error: Class "Monolog\Logger" not found in /home/mt/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:60 Stack trace:

I use the version 3.5.0

Justman100 avatar Apr 01 '24 09:04 Justman100

This error does not make any sense. The Monolog\Logger class exists in Monolog. Make sure you don't have a corrupted vendor/monolog/monolog folder (you can use composer reinstall monolog/monolog)

stof avatar Apr 01 '24 12:04 stof

This error does not make any sense. The Monolog\Logger class exists in Monolog. Make sure you don't have a corrupted vendor/monolog/monolog folder (you can use composer reinstall monolog/monolog)

Still comes

Justman100 avatar Apr 01 '24 15:04 Justman100

It occurs a another error too

PHP Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::emergency($message, array $context = []) in /home/mt/vendor/monolog/monolog/src/Monolog/Logger.php on line 681

Justman100 avatar Apr 01 '24 15:04 Justman100

Do you have the psr PHP extension installed ? If yes, please remove it. This extension is totally broken because it does not account for the fact that all psr/* packages have multiple versions. The working way is to rely on the userland implementation of the PSR interfaces which are managed by composer.

stof avatar Apr 02 '24 08:04 stof

Do you have the psr PHP extension installed ? If yes, please remove it. This extension is totally broken because it does not account for the fact that all psr/* packages have multiple versions. The working way is to rely on the userland implementation of the PSR interfaces which are managed by composer.

Hmm, removed! But still comes

Justman100 avatar Apr 02 '24 11:04 Justman100

@Seldaek

Justman100 avatar May 03 '24 09:05 Justman100

@Justman100 yeah sorry i have no idea.. this seems to be an environment issue.

Seldaek avatar May 03 '24 14:05 Seldaek