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

Posted fsong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[symonfy] An error occurred when executing the "'cache:clear --no-warmup'"相关的知识,希望对你有一定的参考价值。

Symfony Version: 3.4.*

当运行 composer update 会出现

[RuntimeException]                                                                                                                                       
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                
                                                                                                                                                           
                                                                                                                                                           
                                                                                                                                                           
  php Fatal error:  require_once(): Failed opening required '/srv/www/htdocs/sfs/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistr  
  y.php' (include_path='.:/usr/share/php7:/usr/share/php7/PEAR') in /srv/www/htdocs/sfs/var/cache/dev/ContainerFoco7kp/appDevDebugProjectContainer.php on  
   line 714                                                                                                                                                
                                                                                                                                                           
  In appDevDebugProjectContainer.php line 714:                                                                                                             
                                                                                                                                                           
    Compile Error: require_once(): Failed opening required '/srv/www/htdocs/sfs                                                                            
    /vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.                                                                            
    php' (include_path='.:/usr/share/php7:/usr/share/php7/PEAR')              

运行 composer update --no-scripts

而解决 doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php 文件不存在,

我是参考 doctrine common 2.9 has moved reflection

在 composer.json 中 添加

"conflict": {
    "doctrine/common": ">2.8"
}

然后运行 composer update --no-scripts

重新运行 composer require doctrine/common

[email protected]:/srv/www/htdocs/sfs> composer update --no-scripts    
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 3 removals
  - Removing doctrine/reflection (v1.0.0)
  - Removing doctrine/persistence (v1.0.1)
  - Removing doctrine/event-manager (v1.0.0)
  - Updating doctrine/common (v2.9.0 => v2.8.0): Downloading (100%)         
  - Updating doctrine/dbal (v2.8.0 => v2.7.2): Downloading (100%)         
Writing lock file
Generating autoload files

看到 doctrine/common 降到 2.8.0了,直接运行 composer update 也不会报错了


参考

  1. doctrine common 2.9 has moved reflection
  2. An error occurred when executing the “‘cache:clear --no-warmup‘” command

以上是关于[symonfy] An error occurred when executing the "'cache:clear --no-warmup'"的主要内容,如果未能解决你的问题,请参考以下文章

An error occurred while collecting items to be installed session context was:(profile=DefaultProfile

信息: Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will

[Java Web]Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors(

Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be l

java A JNI error has occurred, please check your installation and try again A JNI error has occurr

求解答在eclipse中运行Android项目出现的问题 ——Launching MyFirstAPP' has encountered a program. Errors occurre