PHP使用curl模拟用户登录报错“SSLcertificate:unabletogetlocalissuercertificate”

已邀请:

分析:通过curl访问https连接,报错SSL certificate: unable to get local issuer certificate


解决:

1、下载证书:http://curl.haxx.se/ca/cacert.pem

2、将文件上传至php目录,例如D:\phpstudy_pro\Extensions\php\php7.3.4nts\cacert.pem

3、在php.ini 增加配置:curl.cainfo="D:\phpstudy_pro\Extensions\php\php7.3.4nts\cacert.pem"

4、重启PHP即可

要回复问题请先登录注册