I have some Firebase php code which works well on localhost but when I run it online I get server error 500 and no specific or helpful error message. Firebase say the following in the docs for the REST API:
HTTPS is required. Firebase only responds to encrypted traffic so that our data remains safe.
https://www.firebase.com/docs/rest/api/
The server has only HTTP. If I replace the Firebase code with php it works and when putting the Firebase stuff back it gives server error 500 again.
I tried on a second server which also only has HTTP and Firebase works.
Both servers are running on LAMP.
The code:
<?php
// Not working
require '../../../lib/Firebase/url.php';
getFirebase($require = true);
$firebase = new Firebase\FirebaseLib($url, $token);
$test = array(
"foo" => "bar",
"i_love" => "lamp",
"id" => 42
);
$firebase->set("/test/", $test);
////////////////////////////////
// Working
header('Location: ../../../');
What's the problem?