【发布时间】:2016-05-09 00:15:43
【问题描述】:
执行此命令时出现错误:
php app/console cache:clear --env=prod && php app/console cache:clear --env=dev && php app/console assets:install --symlink && php app/console assetic:dump
错误是:
[Symfony\Component\Debug\Exception\ContextErrorException] 可捕获 致命错误:参数 1 传递给 Sonata\AdminBundle\Security\Handler\RoleSecurityHandler::__construct() 必须实现接口 Symfony\Component\Security\Core\SecurityContextInterface,null 给定的,调用的 /opt/preprod/app/cache/pro_/ap_ProdProjectContainer.php 第 1923 行 并定义
你能帮忙吗,我真的不知道如何解决这个问题
编辑
我尝试备份
composer.lock
和
供应商
目录(然后删除它们)。然后我手动删除了缓存。 然后我安装了作曲家,但是当我安装作曲家时错误又回来了。
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[Symfony\Component\Debug\Exception\ContextErrorException]
Catchable Fatal Error: Argument 1 passed to Sonata\AdminBundle\Security\Handler\RoleSecurityHandler::__construct() must implement interface Symfony\Component\Security\Core\SecurityContextInterface, null given, called in /opt/preprod/app/cache/dev/appDevDebugProjectContainer.php on line 4984 and defined
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
php app/check.php 给我一切都好
所以我没有找到解决这个问题的方法
【问题讨论】:
-
您是否尝试使用
rm -rf app/cache/*删除缓存? -
您应该先手动清除缓存,然后将每个命令的结果单独发布,以便我们帮助您找到问题。它可能与供应商冲突有关,因此您可能需要备份供应商 (mv vendor vendor_bkp) 并运行 composer install。