收藏
回答

微信支付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

无法载入私钥。

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

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

3 个回答

  • Memory (私信不回复)
    Memory (私信不回复)
    03-31

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

    03-31
    有用 1
    回复
  • 森林部落
    森林部落
    03-31

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

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

    03-31
    有用 1
    回复
  • 大才广告字 显示屏13805314342
    大才广告字 显示屏13805314342
    04-03

    真是万分感谢。终于知道这个问题的原因了。 被腾讯的文档坑的不轻。

    04-03
    有用
    回复
登录 后发表内容