think-cache报错think\cache\Driver::unserialize()

原地漫步

问题描述

think-cache : Argument 1 passed to think\cache\Driver::unserialize()
读取缓存think-cache报错
偶尔会报default.ERROR: TypeError: Argument 1 passed to think\cache\Driver::unserialize() must be of the type string, bool given

然后造成程序堵塞,和数据锁定,webman一直报错无法正常运行。

程序代码

\think\facade\Cache::get('config')

截图报错信息里报错文件相关代码

操作系统及workerman/webman等框架组件具体版本

Ubuntu 20.04.6
php 7.4.33
Nginx 1.22.1
MySQL 5.6.50

779 4 0
4个回答

xiuwang

think-cache bug得找tp官方

  • 暂无评论
lethe

你这个问题解决了吗

  • 暂无评论
liziyu

这个问题我也遇到过。是tp与php版本兼容问题好像。

default.ERROR: TypeError: Argument 1 passed to think\cache\Driver::unserialize() must be of the type string, bool given.

具体我不记得是怎么解决的了,按照这个来就行了。

  • 暂无评论
ric

代码问题吧,\think\facade\Cache::get('config')值有问题,导致反系列化的时候失败,看看是不是为null或者空、false了

  • 原地漫步 2023-09-19

    Cache 这个应该不是最新的,自己改了核销代码搞定了

🔝