php - cURL错误60 : SSL certificate in Laravel 5 while Facebook authentication如何解决

标签 php facebook ssl curl laravel-5

目前,我在laravel5上做一个项目。

我使用 socialize 进行 Facebook 身份验证,但出现下面提到的 cURL 错误。

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

我在互联网上搜索并做了以下更改但没有帮助

  • 下载了 cart.pem 文件
  • 设置路径 "curl.cainfo ="C:\xampp\cacert.pem"
  • 同时取消注释“extension=php_curl.dll”

我在 Controller 中的代码

public function fb()  
{
    return Socialize::with('facebook')->redirect();
}
public function cb()    //callback for facebook
{
    $user = Socialize::with('facebook')->user();
    var_dump($user);
}

最佳答案

在使用 Laravel 的本地主机上时,您可以轻松绕过 cURL 错误。

导航到 Client.php 文件(vendor\guzzlehttp\guzzle\src\Client.php)

将“验证”更改为假

$defaults = [
        'allow_redirects' => RedirectMiddleware::$defaultSettings,
        'http_errors'     => true,
        'decode_content'  => true,
        'verify'          => false,
        'cookies'         => false
    ];

关于php - cURL错误60 : SSL certificate in Laravel 5 while Facebook authentication如何解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30974869/

相关文章:

php - Laravel 5.2 - 未显示验证错误

php - 使用 Facebook 注册插件后无法获取用户

node.js - 使用 facebook nodejs sdk 发布到群组 : OAuthException

python - python请求中的OpenSSL错误

python 错误: asking for ssl module while it is built in

PHP 将表单值作为 XML 字符串发布

PHP session 在 CentOS 上无法使用 phpMyAdmin

php - pdo 异常 "colunt not find driver in ..."

ssl - SSL中的随机数如何混淆以防止第三方生成相同的主 key ?

android - 样式化 FacebookActivity 以避免糟糕的进度条