cURL错误60:SSL证书:无法获取本地颁发者证书 [英] cURL error 60: SSL certificate: unable to get local issuer certificate
问题描述
我在本地开发环境中使用wamp,并尝试向信用卡收费,但收到错误消息:
cURL错误60:SSL证书问题:无法获取本地颁发者证书
我搜索了很多人建议我下载此文件: cacert.pem
把它放在某个地方,指向我的php.ini。这是我的php.ini中的部分
curl.cainfo =C:\Windows\cacert.pem
然而,即使重新启动我的服务器多次并更改路径,我得到相同的错误消息。
我使用Apache模块中的wamp并启用了ssl_module。并从php扩展我有php_curl启用。
仍然有同样的错误信息。 Wtf。
现在我正在修复这个问题:如何修复PHP CURL错误60 SSL
这表明我添加这些行到我的cURL选项:
curl_setopt($ process,CURLOPT_CAINFO,dirname(__ FILE__)。'/cacert.pem');
curl_setopt($ process,CURLOPT_SSL_VERIFYPEER,true);
我在哪里可以添加选项到我的cURL?显然不是通过命令行,因为我的CLI没有找到命令curl_setopt
EDIT
这是我正在运行的代码:
public function chargeStripe()
{
$ stripe = new Stripe;
$ stripe = Stripe :: make(env('STRIPE_PUBLIC_KEY'));
$ charge = $ stripe-> charges() - > create([
'amount'=> 2900,
'customer'=> get('stripeEmail'),
'currency'=>'EUR',
]);
dd($ charge);
// echo $ charge [Input :: get('stripeToken')];
return Redirect :: route('step1');
}
>
- 假设在Windows上
XAMPP服务器
类似于其他环境
- 下载并解压缩cacert.pem(一个干净的文件格式/数据)
https:// gist.github.com/VersatilityWerks/5719158/download
- li>
C:\ xampp\php\extras\ssl\cacert.pem
- 在此部分中添加此行:
;;;;;;;;;;
; php.ini选项;
;;;;;;;;;;;;
curl.cainfo =C:\xampp\php\extras\ssl\cacert.pem
- 重新启动您的网络服务器/ apache
问题解决了!
I use wamp on a local development environment and am trying to charge a credit card but get the error message:
cURL error 60: SSL certificate problem: unable to get local issuer certificate
I googled a lot and lots of people are suggesting, that I download this file: cacert.pem
Put it somewhere and point through my php.ini to it. This is the part in my php.ini
curl.cainfo = "C:\Windows\cacert.pem"
Yet, even after restarting my server several times and changing the path, I get the same error message.
I use wamp from the Apache Modules and have the ssl_module enabled. And from the php extensions I have php_curl enabled.
Still the same error message. Wtf.
Now I am following this fix: How to fix PHP CURL Error 60 SSL
Which suggests that I add these lines to my cURL options:
curl_setopt($process, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt($process, CURLOPT_SSL_VERIFYPEER, true);
Where do I add options to my cURL? Apparently not through the command line, since my CLI doesn't find the command "curl_setopt"
EDIT
This is the code I am running:
public function chargeStripe()
{
$stripe = new Stripe;
$stripe = Stripe::make(env('STRIPE_PUBLIC_KEY'));
$charge = $stripe->charges()->create([
'amount' => 2900,
'customer' => Input::get('stripeEmail'),
'currency' => 'EUR',
]);
dd($charge);
// echo $charge[Input::get('stripeToken')];
return Redirect::route('step1');
}
working solution:
- Assuming On windows
XAMPP server
similar for other environment - download and extract for cacert.pem here (a clean file format/data)
- put it here
C:\xampp\php\extras\ssl\cacert.pem
- in your php.ini put this line in this section:
;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;; curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
- restart your webserver/apache
Problem solved!
这篇关于cURL错误60:SSL证书:无法获取本地颁发者证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!