我正在尝试在Symfony 3中为Ubuntu 16.04实现一个Symfony2项目(来自Ubuntu 14.04),而且我已经打了一个墙。当我运行composer update(verbose)时,我收到以下异常并在最后跟踪,我不确定如何清除它。我知道我做错了什么,但是这个例外对于确定问题的位置并不是很有帮助。有没有人遇到过这个问题并且知道一些可能的罪魁祸首?
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: Invalid argument supplied for foreach()
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: Invalid argument supplied for foreach()
Exception trace:
() at /vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:293
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::executeCommand() at /vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:143
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:238
Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:192
Composer\EventDispatcher\EventDispatcher->doDispatch() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:79
Composer\EventDispatcher\EventDispatcher->dispatch() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:177
Composer\EventDispatcher\EventDispatcher->doDispatch() at /usr/share/php/Composer/EventDispatcher/EventDispatcher.php:94
Composer\EventDispatcher\EventDispatcher->dispatchScript() at /usr/share/php/Composer/Installer.php:337
Composer\Installer->run() at /usr/share/php/Composer/Command/UpdateCommand.php:173
Composer\Command\UpdateCommand->execute() at /usr/share/php/Symfony/Component/Console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /usr/share/php/Symfony/Component/Console/Application.php:841
Symfony\Component\Console\Application->doRunCommand() at /usr/share/php/Symfony/Component/Console/Application.php:189
Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:166
Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:120
Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:99
Composer\Console\Application->run() at /usr/bin/composer:44
答案 0 :(得分:0)
您是否删除/添加了lib并忘记从AppKernel中删除/添加它?