致命错误:第16行的app/console中找不到类'Symfony\Component\Console\Input\ArgvInput'

all*_*mon 21 php symfony composer-php

我有一个工作的symfony应用程序,今天我决定做一个 composer update

该结果composer update可以发现,奔这里https://github.com/allan-simon/oauth2-symfony2-vagrant-fosuserbundle/commit/dfa25593f79c5595ca4759803ec1e998091c68b9 (于小的版本大多发生变化,注意,是在symfony中的版本变化,但保持它2.6也产生下面的问题)

现在升级后我收到了这个错误

脚本Sensio\Bundle\DistributionBundle\Composer\ScriptHandler :: clearCache处理post-update-cmd事件以异常终止

[RuntimeException]                                                                                                
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                         
  PHP Fatal error:  Class 'Symfony\Component\Console\Input\ArgvInput' not found in /vagrant/app/console on line 16  
  .   
Run Code Online (Sandbox Code Playgroud)
  • app/console的内容没有改变
  • 我已经尝试删除并重新创建bootstrap.cache没有变化
  • 在我的供应商目录中,我确实有ArgvInput上课

关于问题是什么的任何想法?

all*_*mon 27

问题是因为我composer.json有线

"sensio/distribution-bundle": ">=2.3.7",
Run Code Online (Sandbox Code Playgroud)

因此它更新到最新版本(编写本文时为5.x),这与symfony 2.7及以下项目的文件结构不兼容

相反,我已经把线

"sensio/distribution-bundle": "~4.0",
Run Code Online (Sandbox Code Playgroud)

现在它工作正常

这里有更多解释

https://github.com/sensiolabs/SensioDistributionBundle/issues/243

  • 如果您仍想更新到分发包5,则应遵循以下说明:https://github.com/symfony/symfony-standard/blob/2.8/UPGRADE-2.8.md (12认同)