2017-09-15 176 views
0

我试图在Symfony 3中为Ubuntu 16.04实现一个Symfony2项目(来自Ubuntu 14.04),并且我打了一下墙。当我运行作曲家更新(详细)时,我收到以下异常和最后跟踪,我不确定如何清除它。我知道我做错了什么,但是这个例外并不完全有助于确定问题出在哪里。有没有人遇到过这个问题,并知道一些可能的罪魁祸首?Symfony 3作曲者更新ContextErrorException

[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

既然它是失败的clearCache我会尝试只是强制删除(手动)缓存文件夹的内容,看看是否解决了问题 – JimL

+0

我试过了,它没有。 – Epicedion

+0

找到一个最近添加的代码,其中包含foreach,在控制台命令中使用null作为参数或失败的新捆绑包。 –

回答

0

您是否删除了/添加了一个lib并忘记从AppKernel中删除/添加它?

+0

不幸的是,这似乎并非如此。 – Epicedion