w7corp/easywechat

发现异常

在升级Tp6.1到Tp8.1的过程中,composer已经升级完成,接口也可以正常访问了,但是由于Tp升到8.0了,EasyWechat不能还停留在5.3,因此想着将EasyWechat升级到最新6.7的版本,因此将EasyWechat一起升级了,修改完代码,发起访问时,代码爆出下面异常。

psr/simple-cache 3.0+ is not compatible with this version of symfony/cache. Please upgrade symfony/cache to 6.0+ or downgrade psr/simple-cache to 1.x or 2.x

去问了小冰,是这么告诉我的

依次查看,发现都不是和我相似的问题。

查找问题

[2024-11-28T16:41:08+08:00][error] [0]psr/simple-cache 3.0+ is not compatible with this version of symfony/cache. Please upgrade symfony/cache to 6.0+ or downgrade psr/simple-cache to 1.x or 2.x.
[2024-11-28T16:41:08+08:00][exception.error] E:\project\php\PayCenter\vendor\symfony\cache\Psr16Cache.php[23]:psr/simple-cache 3.0+ is not compatible with this version of symfony/cache. Please upgrade symfony/cache to 6.0+ or downgrade psr/simple-cache to 1.x or 2.x.

在日志中可以看到这个异常,我特意去composer.lock文件中找了找,可以看到在tp框架中依赖了这个扩展

而thinkorm中也依赖了

而EasyWechat中也依赖了

解决

因此,我试着在自己的composer.json中依赖了"psr/simple-cache": "^2.0.0"的版本,再重新执行下composer update命令。

于是问题便解决了。