PHP cURL error 60: SSL certificate problem: unable to get local issuer certificate的解决

本文指导如何使用PHP的cURL函数处理SSL问题,包括从cURL官网下载cacert.pem证书,将其放置到php.ini中并设置curl.cainfo和openssl.cafile。适合不想在代码中指定证书路径的开发者。
摘要由CSDN通过智能技术生成

PHP

参考问题解决方案*3
查找资料:
To use a certificate with PHP’s cURL functions, you can download the cacert.pem certificate bundle from the official cURL website. Once you have downloaded the cacert.pem file, you should move it to whatever directory makes the most sense for you and your setup.
Then, you can simply tell cURL where your certificate bundle is located by using the curl_setopt function:
翻译一下就是SSL的问题,需要去官网下一个证书,并修改php.ini的配置文件,即可。
官网在这里 官网,进去点击下载即可。
将文件保存在本地某个位置(我放在php的安装目录下了)
然后打开php.ini文件,在最后添加如下行:

curl.cainfo="你的path\cacert.pem" 
openssl.cafile="你的路径\cacert.pem"

Adding the cert to your php.ini file.
If you don’t like the thought of having to specify the location of the certificate bundle in your PHP code, then you can add it’s path information to your php.ini file like so:

Once you add the above lines to your php.ini file, make sure that you reload the web server / PHP process so that the changes take effect.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值