PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 10, 2022

[FIXED] facebook v4 sdk class thrwoing error T_OBJECT_OPERATOR in file FacebookSession.php

 February 10, 2022     facebook, facebook-php-sdk, php     No comments   

Issue

I am trying to use facebook v4 sdk for login. When I call the function it generates following error

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /Facebook/FacebookSession.php on line 93

I checked the file and found this is the function that throws error

public function getSessionInfo($appId = null, $appSecret = null)
  {
    $targetAppId = static::_getTargetAppId($appId);
    $targetAppSecret = static::_getTargetAppSecret($appSecret);
    return (new FacebookRequest(
      static::newAppSession($targetAppId, $targetAppSecret),
      'GET',
      '/debug_token',
      array(
        'input_token' => $this->getToken(),
      )
    ))->execute()->getGraphObject(GraphSessionInfo::className());
  }

But I am not able to understand what is wrong in this .

Can any one help me out please Thanks in advance


Solution

You are most likely not using PHP 5.4+. The PHP SDK 4.x requires a PHP Version greater than or equal to 5.4 - many providers did not upgrade yet, unfortunately. You need to ask your provider if he is willing to upgrade, or use the older PHP SDK 3.x (not recommended).



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing