Failed to connect to graph.facebook.com port 443: Network unreachable

前端 未结 1 608
春和景丽
春和景丽 2021-01-13 09:37


        
相关标签:
1条回答
  • 2021-01-13 10:25

    I know this is an old question and the OP might have already found the solution. I also bumped into the same issue while working with the Laravel Socialite plugin.

    For posterity, I would like to post the solution here. The issue is explained in this question: the domain graph.facebook.com resolves to an IPV6 address which some networks may not be configured to route. You can request cURL to resolve IP addresses to their IPV4 values. Set the option CURLOPT_IPRESOLVE to CURL_IPRESOLVE_V4.

    In the case of the socialite plugin, we had to modify the FacebookProvider.php to include the additional option.

    Edit

    To be more specific, Socialite uses GuzzleHttp, and we need to pass this as a parameter to the GuzzleHttp Client method:

    'curl' => [ CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4]
    
    0 讨论(0)
提交回复
热议问题