2017-09-15 32 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