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

半城伤御伤魂 提交于 2019-12-01 05:21:14
Rajesh

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]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!