ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

EasyWeChat报错Failed to cache access token.

EasyWeChat报错Failed to cache access token.

Failed to cache access token.

调用image
报错
image

解决办法

方案一: 安装 Symfony Cache

composer require symfony/cache

查看/tmp下面的symfony-cache是否之前被其他用户创建,如果被其他用户创建则无权限,需要删除。
image

方案二: 手动指定缓存目录

        $config = ['app_id'        => "app_id",'secret'        => "secret",'aes_key'       => '',  // 明文模式可留空'response_type' => 'array',// ✅ 指定缓存驱动'cache' => new FilesystemAdapter('easywechat',   // 缓存命名空间1500,           // 缓存有效时间(秒)runtime_path() . 'easywechat-cache' // 缓存路径),];$this->app = Factory::officialAccount($config);

在runtime/easywechat-cache下面

返回列表