thinkphp 中安装 overtrue/wechat 后运行报错 Failed to cache access token ,原因如下:

在 overtrue/wechat SDK 中的所有缓存默认使用文件缓存,缓存路径取决于 PHP 的临时目录,默认情况下存储在 /tmp/symfony-cache 目录下, 报这个错误的原因一般是缓存目录没有写权限导致的,需要给缓存目录赋予进程执行用户的写权限,如php以www用户执行, 赋予写权限

sudo chown www:www  /tmp/symfony-cache

sudo chmod 644 -R /tmp/symfony-cache