Facebook登录失败连接到graph.facebook.com:443; 操作正在进行中

 其穗茹 发布于 2022-12-04 00:46

我正在尝试实现facebook登录,我有以下代码.

$helper = new Facebook\FacebookRedirectLoginHelper(URL('facebook/login'), $apiVersion = NULL);
try
{
    $session = $helper->getSessionFromRedirect();
} catch (Facebook\FacebookRequestException $ex)
{
    // When Facebook returns an error
    return Redirect::to('login')->with('error-message', 'Facebook could not validate your account.');
} catch (\Exception $ex)
{
    // When validation fails or other local issues
    // FAIL HAPPENS HERE 
    return $ex->getMessage();
}

但我明白了

Facebook login Failed connect to graph.facebook.com:443; Operation now in progress

正如无法连接到graph.facebook.com端口443:网络无法访问我试过

  $data = file_get_contents('https://graph.facebook.com/4'); print_r( $data );

这导致页面在加载时看起来失败,正如我所建议的那样

$ch = curl_init("https://google.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); print($data);

这导致谷歌被加载到我的页面.

不幸的是没有给出解决方案,所以希望其他人可以帮助我.

//我在共享主机上,我无法更改php.ini文件

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有