Symfony2 - Composer清除缓存错误

时间:2014-08-20 08:03:30

标签: php linux symfony composer-php

尝试清除symfony2项目中的缓存时,收到此错误消息:

PHP Fatal error:  Call to undefined method Symfony\Component\Console\Output\ConsoleOutput::isVerbose() in /var/staging_www/www.sciforum.net/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php on line 87

有什么想法吗?谢谢。

编辑:

尝试更新供应商时,收到此错误消息:

Clearing the cache for the dev environment with debug true
PHP Fatal error:  Call to undefined method Symfony\Component\Console\Output\ConsoleOutput::isVerbose() in /var/staging_www/www.sciforum.net/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php on line 99
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception



[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

3 个答案:

答案 0 :(得分:0)

检查composer.json中的版本(并在composer.lock中仔细检查基于Symfony的库的版本)。 isVerbose仅在版本2.4的ConsoleOutput中可用。

您可能有一些Symfony库的混合版本。

答案 1 :(得分:0)

如果先删除目录,可以修改:

sudo rm -rf app/logs
sudo rm -rf app/cache

答案 2 :(得分:0)

我也遇到过类似的问题。为 CLI 禁用 PHP opcache 对我有帮助。

php.ini 中禁用它:

opcache.enable_cli=0

保存文件并再次尝试清除缓存。