2

I'm having a terrible time of it trying to implement the Facebook PHP SDK on a new server. I'm running the following code:

require('facebook.php');

$facebook = new Facebook(array(
    'appId' => "###",
    'secret' => "###",
));

$signed_request = $facebook->getSignedRequest();
$like_status = $signed_request["page"]["liked"];

if ($like_status) {
    include('fan.php');
}
else {
    include('visitor.php');
}

This all works perfectly under my server running PHP 5.2.17, but breaks under PHP 5.3.3. Both servers have cURL and JSON functioning properly. As far as I can tell, no errors are being thrown, but $facebook->getSignedRequest(); is returning as null.

I'm almost certain that there's something in my server configuration that's bollocksing the whole thing up, but for the life of me I can't figure out what. Any help would be greatly appreciated. Thanks in advance!

Wyatt
  • 21
  • 2
  • Blocked ports maybe? Try checking your firewall. – Patrick Perini Jun 23 '11 at 17:46
  • The server is pretty locked down; any idea what ports I should look at? – Wyatt Jun 23 '11 at 19:36
  • I would try cURL requests on port 80, 443, 591, and 593 (HTTP/S and its alternates), as well as checking those ports on the firewall. That will give you an idea of what resources you as a user have access to, and what your PHP scripts can access. – Patrick Perini Jun 23 '11 at 22:36

1 Answers1

1

I looked into the FB PHP SDK, getSignedRequest method and it used the $_REQUEST superglobal, the PHP manual says that in

5.3.0 - Introduced request_order. This directive affects the contents of $_REQUEST.

Either the values of $_REQUEST are overwritten somehow. This might be something to look into.

Arvin
  • 2,272
  • 14
  • 10
  • Switching it around from `$facebook->getSignedRequest();` to `$signed_request = $_REQUEST["signed_request"];` returns `Notice: Undefined index: signed_request`. Not exactly sure if this is closer or further from a solution. Thanks for the idea though! – Wyatt Jun 23 '11 at 19:35
  • @Wyatt Did you try checking if `$_GET` and `$_POST` contains something that is not in `$_REQUEST`? – Arvin Jun 24 '11 at 12:44