How solve cURL error 60: SSL certificate in Laravel 5?

前端 未结 2 1610
-上瘾入骨i
-上瘾入骨i 2021-01-16 14:44

I\'m using \"FriendsOfPHP/Goutte\" Package https://github.com/FriendsOfPHP/Goutte For web crawling... When I use \"http://\" links then it\'s ran correctly but when I use \"

相关标签:
2条回答
  • 2021-01-16 15:21

    Try disabling CURLOPT_SSL_VERIFYPEER to stop cURL from verifying the peer's certificate:

    $client->getClient()
           ->setDefaultOption('config/curl/' . CURLOPT_SSL_VERIFYPEER, false);
    
    0 讨论(0)
  • 2021-01-16 15:30

    I think you have a certificate problem. It seems Goutte depends on Guzzle 4. And Guzzle can't find the proper certificate to verify a secure https request, see more about it here.

    Try to download this file: Bundle of CA Root Certificates . (Open and Save As).

    Then locate your php.ini file and add,or edit if it already exists, this line

    curl.cainfo = "[pathtothisfile]\cacert.pem"

    0 讨论(0)
提交回复
热议问题