-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration of Monolog\Logger::emergency void must be compatible (again) #1808
Comments
I ran into a probable problem, my hosting has php extension installed https://github.com/jbboehr/php-psr |
This isn't a monolog issue, but a dependency issue. Somehow you must have an outdated psr/log loaded somewhere. You gotta figure out why that is. |
The issue with the php-psr extension is that it does not account for the fact that PSR packages have multiple versions. The fix is to disable the extension. This extension is known to be the root cause of hundreds of similar issues, and there is no benefit of using it vs using the userland package IMO (if you are concerned about the impact of autoloading, use the preload feature of PHP instead) |
Hi @Seldaek , is there some place else but |
You can add |
I have the same problem as my colleague, any solution for this? |
Well, as he did not answer the question of @Seldaek, this would be a good start. |
as a hot fix, downgrade monolog to 2.9, because the latest version still produce this error |
Hi, I had the same problem on an internal project. In my case, following @Seldaek suggestion var_dump(
class_exists('Psr\Log\LoggerInterface'),
(new \ReflectionClass('Psr\Log\LoggerInterface'))->getFileName()
); at the top of problematic class and get bool(false)
string(67) "phar:///usr/bin/composer/vendor/psr/log/Psr/Log/LoggerInterface.php" The problem seems to come from psr/log version of composer, as mention in composer/composer#11246 (comment) I will explore the suggestion of splitting script off into its own process/command that I can call as a script. |
I confirm that using intermediate bash script to run php command bypass this issue. |
Monolog version 3
I'm getting a similar/same issue as described in #1764.
I'm pulling my dependencies with
The platform is as follows:
I get bitten by this when running some composer hooks. I tracked down the problem to
$array = Yaml::parse($yaml, Yaml::PARSE_CONSTANT);
(Symfony Yaml class). Interestingly, the composer hooks never pull in Monolog, but it still somehow gets pulled in (I'm not logging anything, and where a loggerinterface is required to instantiate a class, I use Psr\Log\NullLogger()).Honestly I'm at loss on how to further debug/fix this. I don't know how Monolog gets pulled in. It seems that Symfony errors out on something and somehow ends up using Monolog while at the same time (maybe) throwing its on LoggerInterface implementation that is part of the Symfony\Console dependency. I'll appreciate any ideas or pointers.
The text was updated successfully, but these errors were encountered: