上次介绍了如何在PHP8下运行 FastAdmin,今天在FastAdmin下安装 和使用EasyWeChat,EasyWeChat 是一个开源的 微信 非官方 SDK。安装非常简单,因为它是一个标准的 Composer 包,这意味着任何满足下列安装条件的 PHP 项目支持 Composer 都可以使用它。
EasyWeChat环境需求 PHP >= 8.0,上一次我们已经在PHP8下安装了FastAdmin,正常情况下直接安装easyWeChat 就可以了,但是直接使用 composer require w7corp/easywechat:^6.7 命令安装是安装不上的,直接修改composer.js 文件,改为下面的,正常就可以安装了,
"require": {
"php": ">=8.0",
"topthink/framework": "dev-master",
"topthink/think-captcha": "^1.0",
"topthink/think-installer": "^1.0.14",
"topthink/think-queue": "1.1.6",
"topthink/think-helper": "^1.0.7",
"overtrue/pinyin": "^3.0",
"phpoffice/phpspreadsheet": "1.19",
"karsonzhang/fastadmin-addons": "^2.1",
"ext-json": "*",
"ext-curl": "*",
"ext-pdo": "*",
"ext-bcmath": "*",
"txthinking/mailer": "^2.0",
"nelexa/zip": "^4.0.0",
"overtrue/socialite": "4.0.1",
"w7corp/easywechat": "6.7"
}
安装后后台会出现错误,是因为fastadmin-addons的版本太高了,我们把2.1的版本删掉,将原来的文件复制回来,就会正常了

原创文章,作者:admin,如若转载,请注明出处:https://ntib.cn/208.html