环境配置
环境要求
- PHP >= 7.0
- PHP cURL 扩展
- PHP OpenSSL 扩展
- PHP SimpleXML 扩展
- PHP fileinfo 拓展
手册链接
EasyWeChat:https://easywechat.com/4.x/overview.html
安装命令
composer require overtrue/wechat:~4.0 -vvv
项目配置
公共配置文件:config新建wechat.php
<?php
return [
'token'=>'ask', // Token
'app_id'=>'wx5f95edfa7587efba', //appID
'secret'=>'6dd3ed470d677c735aa8cda6daf4e534', // appsecret
'response_type' => 'array',
/**
* 日志配置
*
* level: 日志级别, 可选为:
* debug/info/notice/warning/error/critical/alert/emergency
* path:日志文件位置(绝对路径!!!),要求可写权限
*/
'log' => [
'default' => 'dev', // 默认使用的 channel,生产环境可以改为下面的 prod
'channels' => [
// 测试环境
'dev' => [
'driver' => 'single',
'path' => public_path().'logs/'.date('Y-m-d').'/easywechat.log',
'level' => 'debug',
],
// 生产环境
'prod' => [
'driver' => 'daily',
'path' => public_path().'logs/'.date('Y-m-d').'/easywechat.log',
'level' => 'info',
],
],
]
];
公众平台测试号管理配置