r/Firebase • • May 23 '22

Realtime Database Kreait php realtime database cannot get reference!! (cURL 60 error).

Hey guys, whenever I try to get the value of a reference, I alws get a cURL 60 error. Getting the reference works fine, but getting the value always throws this error!!

Code:

index.php:

<?php
require __DIR__.'/vendor/autoload.php';

use Kreait\Firebase\Factory;

$database = (new Factory)
    ->withServiceAccount("firebase-private-key.json")
    ->createDatabase();

$reference = $database->getReference("userInfo/street");
$value = $reference->getSnapshot();

// If I remove the "$reference->getSnapshot(), line, everything works fine!!!!!!

?>

Directory structure:

/vendor
    ...
    autoload.php
composer.json
composer.lock
firebase-private-key.json
index.php

I am using the php built in server. Any help would me much appreciated!!!!!!

1 Upvotes

Duplicates