我在生产服务器的系统中出现此错误,但我不知道为什么在我的开发服务器中导致一切正常。
致命错误:未捕获的异常'InvalidArgumentException',消息'无法加载类'Twig_Extension_Escaper“'在/ home / content / 79/11253479 / html / witf / path / vendor / symfony / symfony / src / Symfony / Component / ClassLoader / ClassCollectionLoader.php:259堆栈跟踪:#0 /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php(98):Symfony \ Component \ ClassLoader \ ClassCollectionLoader :: getOrderedClasses(Array)#1 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2303):Symfony \ Component \ ClassLoader \ ClassCollectionLoader :: load(数组,'/ home / content / 7 ...','classes',false,false,'。php')#2 /home/content/79/11253479/html/witf/path/app/bootstrap.php。 cache(2139):Symfony \ Component \ HttpKernel \ Kernel-> doLoadClassCache('classes','。php')#3 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache (2173):Symfony \ Component \ HttpKernel \ Kernel-> boot()#4 /home/content/79/11253479/html/index.php(27):Symfon y \ Component \ HttpKernel \ Kernel-> handle(对象(在/home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php上线) 259
答案 0 :(得分:0)
请尝试composer update -o
,之后app/console cache:clear --env=prod
。
进一步检查生产服务器上是否存在vendor/twig/twig/lib/Twig/Extension/Escaper.php
文件。