来自我之前关于stackoverflow的问题:
FB login with oauth-5-laravel Failed to request resource. HTTP Code: No response
我通过更改以下代码行找到了一个替代解决方案:
$fb = OAuth::consumer('Facebook');
到
$OAuth = new OAuth();
$OAuth::setHttpClient('CurlClient');
$fb = $OAuth::consumer('Facebook',route('rgstFb'));
之后我遇到了一些错误如下:
TokenResponseException in CurlClient.php line 135:
Error # 7: Failed to connect to graph.facebook.com port 443: Connection refused
我确实谷歌这个关键词,并找到一条规则说:
1- CurlException: 7: couldn't connect to host
2- Uncaught CurlException: 7: couldn't connect to host
3- CurlException: 7: Failed to connect to 2a03:2880:10:1f02:face:b00c:0:26: Network is unreachable
The first and second problem are usually more general, and can occur due to many reasons, for example your host might have port 80 or port 443 blocked, and your facebook api will fail to connect.
我该怎么办?