Shopware 6.14.19.0升级后扩展插件列表无法显示报错求助
解决Shopware 6.14.19.0升级后插件列表显示的Symfony Intl编译错误
问题描述
已将Shopware升级至最新版本6.14.19.0(PHP 8.1.4),但扩展页面的插件列表无法正常显示,出现如下编译错误:
Compile Error: Declaration of Symfony\Component\Intl\Data\Bundle\Reader\BufferedBundleReader::read(string $path, string $locale) must be compatible with Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface::read(string $path, string $locale): mixed
解决方案
这个错误是Symfony Intl组件版本与Shopware 6.14.19.0依赖要求不匹配,导致接口实现的方法声明不一致,可按以下步骤解决:
清理Shopware缓存与生成文件
执行以下命令彻底清理缓存和自动生成的类文件:bin/console cache:clear --env=prod bin/console cache:clear --env=dev rm -rf var/cache/* var/log/* var/generated/*重新安装匹配版本的依赖
删除composer.lock和vendor目录,重新安装依赖以确保版本完全匹配Shopware的要求:rm composer.lock rm -rf vendor composer install --no-dev --optimize-autoloader强制对齐Symfony Intl组件版本
如果上述步骤未解决问题,可直接指定符合Shopware 6.14.x要求的Symfony Intl版本(通常为^6.4):composer require symfony/intl:^6.4 --no-update composer update symfony/intl --with-all-dependencies重新生成代理类
执行命令生成Shopware所需的代理类:bin/console system:generate-proxies重启服务
重启PHP-FPM或你的Web服务器,确保所有更改生效。
内容的提问来源于stack exchange,提问作者SMS
相关产品推荐
相关产品推荐


