cURL 错误 60:Laravel 5.4 中的 SSL 证书 [英] cURL error 60: SSL certificate in Laravel 5.4

查看:46
本文介绍了cURL 错误 60:Laravel 5.4 中的 SSL 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完全错误

CurlFactory.php 第 187 行中的 RequestException:cURL 错误 60:SSL 证书问题:无法获取本地颁发者证书(请参阅 http://curl.haxx.se/libcurl/c/libcurl-errors.html)

场景

在任何人向我指出这两个 laracasts 答案之前:https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-颁发者证书

Before anyone points me to these two laracasts answers: https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate

https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/52954

我已经看过它们了,这就是我来这里的原因.

I've already looked at them and that's why I'm here.

我遇到的问题是,现在我有了 cacert.pem 文件,但是把它放在哪里没有意义,答案表明将文件放在我的 xampp 目录中并更改我的 php.ini 文件,但我没有使用 xampp 做任何事情,我使用 Laravel 的 artisan 服务器来运行我的项目.

The problem I have is that now I have the cacert.pem file BUT it doesn't make sense where to put it, the answers indicate to place the file in my xampp directory and change my php.ini file but I'm not using xampp for anything, I'm using Laravel's artisan server to run my project.

如果没有使用 xampp,我应该把这个文件放在哪里?此外,为什么可以接受的答案是将它放在我的 xampp 目录中?我不明白.

If xampp is not in use, where should I place this file? Moreover, why would an accepted answer be to place it in my xampp directory? I dont understand.

我的确切问题

我在哪里放置 cacert.pem 文件以在 Laravel 5.4 中阻止此错误?

Where do I place the cacert.pem file to stop this error in laravel 5.4?

推荐答案

不要修改 vendor/ 文件夹中的文件.曾经.它们可以并且将在您运行的下一次 Composer 更新时被覆盖.

Do not ever modify files in the vendor/ folder. Ever. They can and will be overwritten on the next composer update you run.

这是我的 WampServer 解决方案

我的 WampServer 使用的是 PHP 7.1.9,因此将下面示例中的 7.1.9 更改为您当前使用的版本号.

I am using PHP 7.1.9 for my WampServer, so change 7.1.9 in the example below to the version number you are currently using.

  1. 下载此文件:http://curl.haxx.se/ca/cacert.pem
  2. 将此文件放在C:wamp64inphpphp7.1.9文件夹
  3. 打开 php.ini 并找到这一行:
  1. Download this file: http://curl.haxx.se/ca/cacert.pem
  2. Place this file in the C:wamp64inphpphp7.1.9 folder
  3. Open php.iniand find this line:

;curl.cainfo

改为:

curl.cainfo = "C:wamp64inphpphp7.1.9cacert.pem"

确保删除行首的分号.

保存对 php.ini 的更改,重新启动 WampServer,您就可以开始了!

Save changes to php.ini, restart WampServer, and you're good to go!

这篇关于cURL 错误 60:Laravel 5.4 中的 SSL 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆