[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
wakasann@linux-2ywt:/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
也不会报错了