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.