0

Anyone know how I can implement Facebook login for PHP version 5.3. Since the PHP Facebook SDK version only supports PHP 5.4.

How I can implement this as we can't just change our project php version to PHP 5.4 as it may cause the breaking of the system.

I found the below link for php 5.3 version support facebook sdk but it didn't work for me as it through the following error:

Fatal error: Uncaught OAuthException: (#803) Cannot query users by their username (james) thrown in /code/test/mywebsite/public/fb_login/Facebook/base_facebook.php on line 1325 E_ERROR Error in file »base_facebook.php« at line 1325: Uncaught OAuthException: (#803) Cannot query users by their username (james) thrown

The following is the link for php 5.3 facebook php sdk: facebook archive

Thanks.

Jimil
  • 650
  • 2
  • 14
  • 37
  • 2
    You should not be using PHP 5.3, period. (Nor [any version](https://www.php.net/supported-versions) of PHP 5.x.) It [ceased to receive security updates in 2014](https://www.php.net/eol.php). The version of the Facebook SDK that worked with PHP 5.3 will definitely not work with the current versions of the Facebook API, either - it is irreparably outdated. – ceejayoz Jan 31 '20 at 02:39
  • so is thr any other alternative ? – Jimil Jan 31 '20 at 02:41
  • You need to set up a test server running PHP 7.x, test and make any necessary fixes, and transition to a modern version of the SDK. – ceejayoz Jan 31 '20 at 02:42
  • humm not sure if we can migrate the whole system from PHP 5.3 to 7. As I think it would be easy to jump from 5.3 to 5.4 as hopefully that wont require lots of changes. – Jimil Jan 31 '20 at 02:57
  • Anything in the 5.x line is dangerous to run in production. They have unpatched security holes. – ceejayoz Jan 31 '20 at 03:03
  • Use Facebooks "PHP Graph SDK", this should also work up to PHP v7.0/7.1/7.2 https://github.com/facebook/php-graph-sdk – CodyKL Jan 31 '20 at 03:05
  • @CodyKL The latest version that SDK explicitly supports is v2.10. The Facebook API is on v5. It's likely to not work on large portions of Facebook's current API. – ceejayoz Jan 31 '20 at 03:17
  • in addition to the important comment that PHP 5.x is highly outdated: "Cannot query users by their username" - it is not possible with the API anymore, no matter which PHP version you are using. – andyrandy Jan 31 '20 at 07:22
  • Does this answer your question? [graph.facebook.com/username does not work](https://stackoverflow.com/questions/30868201/graph-facebook-com-username-does-not-work) – andyrandy Jan 31 '20 at 07:22
  • Thank you all and now we are trying to upgrade our php version from 5.3 to 5.4 and onwards. I know that its long way to go but at least we can try as it's really large system to do migration while it's highly used by the users. – Jimil Feb 02 '20 at 21:56

0 Answers0