EasyWeChat报错Failed to cache access token.
Failed to cache access token.
调用
报错

解决办法
方案一: 安装 Symfony Cache
composer require symfony/cache
查看/tmp下面的symfony-cache是否之前被其他用户创建,如果被其他用户创建则无权限,需要删除。

方案二: 手动指定缓存目录
        $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下面
    如果这篇文章对你有用,可以关注本人微信公众号获取更多ヽ(^ω^)ノ  ~
 
 


 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号