kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
994 stars 163 forks source link

Unable to connect to the API: cURL error 6 #105

Closed essamtariq123 closed 2 years ago

essamtariq123 commented 2 years ago

I am using this package and when I write

$newPost = app('firebase.database')->getReference('users') ->push([ 'name' => 'sample name' , 'email' => 'sample email', 'accountType' => 'sample' ]);

it gives me an error

Kreait\Firebase\Exception\Database\ApiConnectionFailed Unable to connect to the API: cURL error 6: Could not resolve host: users.json (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) Screenshot 2021-09-01 at 2 47 27 PM

can you please help me resolve the issue. thanks

jeromegamez commented 2 years ago

Please have a look at https://firebase-php.readthedocs.io/en/5.x/troubleshooting.html#curl-error-xx

cURL error 6 (CURLE_COULDNT_RESOLVE_HOST (6) https://curl.se/libcurl/c/libcurl-errors.html) hints at a networking issue 🤔