easywechat Failed to fetch key access_token

不管是原来的还是redis都报下面的错误。有没有大佬解决这样的问题?影响到了线上的项目了。用的基于thinkphp5.1的fastadmin框架。

  1. easywechat 版本4.x
  2. igbinary已安装

easywechat Failed to fetch key access_token

 $config = [
     'app_id' => $this->wechatAppid,
     'secret' => $this->wechatAppsecret,
 ];
 $app = Factory::officialAccount($config);
 $redis = \think\Cache::store('redis')->handler();
 $cache = new RedisAdapter($redis, $namespace = '', $defaultLifetime = 0);
 $app->rebind('cache', $cache);
 $res = $app->template_message->send($data);

总是报这些问题

[ 2024-04-03T18:52:38+08:00 ][ error ] [512]Failed to fetch key "easywechat.kernel.access_token.a5f06943e79b873c805ef86e54fa7586": Failed to unserialize values, did you forget to install the "igbinary" extension?
error
[ 2024-04-03T18:52:38+08:00 ][ error ] [0]Type error: Return value of EasyWeChat\Kernel\AccessToken::getToken() must be of the type array, null returned
error
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 5

defaultLifetime 这个值设置多点,不要为0

3个月前 评论

自己封装一个多好用

3个月前 评论

不是给提示了吗

3个月前 评论
转打瞎比比 (楼主) 3个月前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!