I am trying to implement facebook login, im having the following code.
$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(); }
But I get
Facebook login Failed connect to graph.facebook.com:443; Operation now in progress
As suggested. Could not connect to graph.facebook.com 443 port: Network is unavailable. I tried
$data = file_get_contents('https://graph.facebook.com/4'); print_r( $data );
This causes the page to load with an error. As suggested, I tried
$ch = curl_init("https://google.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $data = curl_exec($ch); print($data);
this led to google loading on my page.
Unfortunately, no solution was found, so I hope someone else can help me.
// Im on shared hosting, I cannot change php.ini files
source share