0

I'm not a PHP Developer as you will see it. But in this moment, i need to make an simple Firebase "query"(Just return/push a few infos to the database). I found this website, that seem to be a connector

I'm actually following the steps showed at the website. Downloaded the Composer, but i didn't get this part

After installing, you need to require Composer’s autoloader: "require 'vendor/autoload.php';" So i made a few changes that suppose to work, i also downloaded that JSON in Firebase console.

But nothing seem to work, let me show my index.php

<?php 
require "C:/xampp/php/vendor/autoload.php";

echo "<h1> Teste do Igor 2017</h1>";
//$firebase = Firebase::fromServiceAccount('google-service-account.json'); (I didn't know what to use so i tried both)
$firebase = Firebase::fromServiceAccount(__DIR__.'/google-service-account.json');
$database = $firebase->getDatabase();
$reference = $database->getReference('nome');
$value = $reference->getValue();
$abc = "teste";

//echo "<p>"+$abc+"</p>";
?>

This is what i got in my page

Teste do Igor 2017

Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\xampp\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 Stack trace: #0 C:\xampp\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\php\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 C:\xampp\php\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object( in C:\xampp\php\vendor\kreait\firebase-php\src\Firebase\Database\ApiClient.php on line 110

I don't understand what is happening. This documentations never have clear examples.

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
  • Have you looked up the errors in Google to see how you should solve them? – Jay Blanchard Mar 08 '17 at 18:29
  • yes, the told me to download and put a file called "cacert.pem" inside of my folders. I already did, but i feel like there is a problem in Firebase. Not sure unfortunately – Igor Santos de Lima Mar 08 '17 at 18:31
  • This has nothing to do with Firebase. Your server's CA list is outdated. Firebase uses a CA that's not on your outdated list. – ceejayoz Mar 08 '17 at 18:34

0 Answers0