Php Symfony 5-捆绑式“;WebProfilerBundle“;不存在或未启用
当我在prod环境中时,如果我尝试Php Symfony 5-捆绑式“;WebProfilerBundle“;不存在或未启用,php,symfony,environment,Php,Symfony,Environment,当我在prod环境中时,如果我尝试缓存:清除,我会出现以下错误: In FileLoader.php line 173: B
缓存:清除
,我会出现以下错误:
In FileLoader.php line 173:
Bundle "WebProfilerBundle" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "App\Kernel.php" file? in @WebProfilerBundle/Res
ources/config/routing/wdt.xml (which is being imported from "C:\Users\user\Desktop\SylviaTest\config/routes/dev/web_profiler.yaml"). Make sure the "WebProfilerBundle/Resources/confi
g/routing/wdt.xml" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@WebProfilerBundle/Resources/co
nfig/routing/wdt.xml" is not empty.
In Kernel.php line 226:
Bundle "WebProfilerBundle" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "App\Kernel.php" file?
我不明白为什么
config/routes/dev/web_profiler.yaml:
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
我在config/routes/prod中没有这个文件,因为我不需要它
在我的config/bundles.php中,我已经:
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'panther' => true],
谢谢你的帮助 您正在执行“bin/console cache:clear--env=prod”,因为cache:clear默认为dev环境,这是您的消息似乎表明正在发生的事情。是的,在my.env中,APP_env ils“prod”。接下来,如果我执行“bon/console cache:clear”,它将清除我的prod环境,并且我有错误,因此console命令首先会回显“清除prod环境的缓存…”?我并不是想反复强调这一点,但再一次,似乎一个非prod环境正在被清除。如果还没有,那么您可以尝试完全删除var/cache目录。有时以前的缓存会干扰创建新缓存。好的,我解决了问题!这是因为我的kernel.php!谢谢你,伙计!:)您正在执行“bin/console cache:clear--env=prod”,因为cache:clear默认为dev环境,这是您的消息似乎表明正在发生的事情。是的,在my.env中,APP_env ils“prod”。接下来,如果我执行“bon/console cache:clear”,它将清除我的prod环境,并且我有错误,因此console命令首先会回显“清除prod环境的缓存…”?我并不是想反复强调这一点,但再一次,似乎一个非prod环境正在被清除。如果还没有,那么您可以尝试完全删除var/cache目录。有时以前的缓存会干扰创建新缓存。好的,我解决了问题!这是因为我的kernel.php!谢谢你,伙计!:)