使用微信支付提示:openssl_sign(): Supplied key param cannot be coerced into a private key
BuTingBa opened this issue · comments
不停 commented
我用的环境
- PHP 版本:php 8.0.26
- overtrue/wechat 版本:6.7
- 是否使用了框架?框架名称:tp6
问题及现象
使用微信支付,提示:openssl_sign(): Supplied key param cannot be coerced into a private key
通过文档,我填写了配置如下:
里面的证书是通过微信证书生成的文件复制到配置目录中的:
这是我测试创建支付的代码
但是提示为:openssl_sign(): Supplied key param cannot be coerced into a private key
这是我openssl的配置:
找了半天想不到问题所在,百度了也没有百度到我想要的信息,能否给点提示或指点迷津,感激不尽。
安正超 commented
感觉配置错了,商户证书和支付证书要分清楚https://easywechat.com/6.x/pay/index.html
不停 commented
感觉配置错了,商户证书和支付证书要分清楚https://easywechat.com/6.x/pay/index.html
经检测,是我服务器目录权限问题,本地开发的证书文件,FTP没有上传到服务器。抱歉。
Litaibao commented
本地创建预支付订单成功,生产环境却提示openssl_sign(): Supplied key param cannot be coerced into a private key是什么情况???证书我上传了的,也仔细检查了。
Litaibao commented
搜索了相关问题,有一个说是和证书是否有空格有关?easywechat6版本大家有遇到这个问题吗?