原因是在请求https资源的时候,要么忽略证书验证,要么必须有证书文件
下载证书文件:
https://curl.haxx.se/ca/cacert.pem
放到一个目录后
配置php.ini,比如我的例子,注意路径必须是绝对路径
curl.cainfo =C:serverphpstudy_proExtensionsphpcacert.pem
linux下解决方式可以参照我之前的文章
[PHP] curl访问https与CA证书问题 - 陶士涵 - 博客园 (cnblogs.com)