'How to remove Deprecated Symfony\Component\Debug\DebugClassLoader?
I have upgrade Symfony 3.4 to 4.4. The only Deprecation warning left is this:
php.INFO: User Deprecated: The "Symfony\Component\Debug\DebugClassLoader" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\DebugClassLoader" instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The "Symfony\Component\Debug\DebugClassLoader" class is deprecated since Symfony 4.4, use "Symfony\Component\ErrorHandler\DebugClassLoader" instead. at /vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:16)"} []
I am not use DebugClassLoader
anywhere. How do I remove this warning?
Solution 1:[1]
Check your index.php
and your bin/console
files.
In index.php
, for example, there should be a part like this:
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
But the corresponding import is likely to be:
use Symfony\Component\Debug\Debug;
In both files change it to:
use Symfony\Component\ErrorHandler\Debug;
Solution 2:[2]
Check your bin/console
file.
You need change:
use Symfony\Component\Debug\Debug;
to:
use Symfony\Component\ErrorHandler\Debug;
When command is executed you will receive a deprecation message.
Solution 3:[3]
Set on your environment file (Eg: .env
) this:
APP_ENV=prod
that should do the trick.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | |
Solution 3 | abranhe |