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

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

问题描述

完全错误

RequestException in CurlFactory.php line 187: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

场景

在有人向我指出这两个laracast答案之前:

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

我已经看过它们了,这就是为什么我在这里,

I've already looked at them and thats why im here,

我遇到的问题是我现在有了cacert.pem文件,但是放在哪里没有意义,答案表明将文件放置在我的xampp目录中并更改了我的php.ini文件,但我没有使用xampp进行任何操作,即时消息使用laravel的工匠服务器运行我的项目.如果未使用xampp,那么我将在何处放置此文件&更何况,为什么要接受的答案是将其放在我不明白的xampp目录中?

The problem i have is that i now 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 im not using xampp for anything, im using laravel's artisan server to run my project. If xampp is not in use then where do i place this file & more so 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/文件夹中的文件.曾经.它们可以并且将在您运行的下一个作曲家更新中被覆盖.

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:\wamp64\bin\php\php7.1.9文件夹中
  3. 打开php.ini并找到以下行:
  1. Download this file: http://curl.haxx.se/ca/cacert.pem
  2. Place this file in the C:\wamp64\bin\php\php7.1.9 folder
  3. Open php.iniand find this line:

;curl.cainfo

将其更改为:

curl.cainfo = "C:\wamp64\bin\php\php7.1.9\cacert.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天全站免登陆