Sve*_*art 5 php facebook facebook-graph-api
我正在尝试实现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();
}
Run Code Online (Sandbox Code Playgroud)
但我明白了
Facebook login Failed connect to graph.facebook.com:443; Operation now in progress
Run Code Online (Sandbox Code Playgroud)
正如无法连接到graph.facebook.com端口443:网络无法访问我试过
$data = file_get_contents('https://graph.facebook.com/4'); print_r( $data );
Run Code Online (Sandbox Code Playgroud)
这导致页面在加载时看起来失败,正如我所建议的那样
$ch = curl_init("https://google.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); print($data);
Run Code Online (Sandbox Code Playgroud)
这导致谷歌被加载到我的页面.
不幸的是没有给出解决方案,所以希望其他人可以帮助我.
//我在共享主机上,我无法更改php.ini文件
| 归档时间: |
|
| 查看次数: |
2755 次 |
| 最近记录: |