收藏
回答

微信支付V3接口的私钥无法载入

// 从本地文件中加载「商户API私钥」,「商户API私钥」会用来生成请求的签名

$merchantPrivateKeyFilePath = 'file:///D:/wwwroot/cert/apiclient_key.pem';

商户私钥用这种目录形式不对吗?提示出错。

Fatal error: Uncaught UnexpectedValueException: Cannot load privateKey from(string), please take care about the \$thing input. in D:\wwwroot\zwd.wcmyks.com\cn_asp\wxPay\wechatpay\weChatPay\Crypto\Rsa.php:178 Stack trace #0 D:\wwwroot\zwd.wcmyks.com\cn_asp\wxPay\wechatpay\transfer.php(16): WeChatPay\Crypto\Rsa::from('file:///D:/wwwr...', 'private' #1 {main} thrown in D:\wwwroot\zwd.wcmyks.com\cn_asp\wxPay\wechatpay\weChatPay\Crypto\Rsa.php on line 178

无法载入私钥。

私钥文件目录没有错,可以在浏览器地址栏打开。

回答关注问题邀请回答
收藏

2 个回答

  • Memory
    Memory
    1天前

    readme示例是linux的路径,所以你会看起来有三个“/”,你用win的时候这样就不对了

    1天前
    有用
    回复
  • 森林部落
    森林部落
    1天前

    $merchantPrivateKeyFilePath = 'file:///D:/wwwroot/cert/apiclient_key.pem';

    file://D:/ ,你多了一个斜杠。

    1天前
    有用
    回复
登录 后发表内容