HEEEEELLLLLLPPPPP!

20 views
Skip to first unread message

Chris

unread,
Feb 11, 2019, 11:20:19 PM2/11/19
to santacr...@googlegroups.com
Trying to access Cloud Firestore from PHP. I believe I have everything set up correctly, and it seems to be accepting my authorization file, and gets as far as the snapshot line, but then throws the error "The Cloud Firestore API is not enabled for the project". I have a separate javascript webpage that accesses this database with no problems whatsoever; trying to build a page for a different purpose that needs to be in PHP, and cannot get past this error.

Here is the PHP code:
putenv("GOOGLE_APPLICATION_CREDENTIALS=c:/XXX/google-auth.json");
require '/vendor/autoload.php';
use Google\Cloud\Firestore\FirestoreClient;
$db = new FirestoreClient();
$docRef = $db->collection('clients')->document('10001');
$snapshot = $docRef->snapshot();

Here is the actual error:
Fatal error: Uncaught Google\Cloud\Core\Exception\FailedPreconditionException: { "message": "The Cloud Firestore API is not enabled for the project xxxxx", "code": 9, "status": "FAILED_PRECONDITION", "details": [] }

Any help would be much appreciated :) :) :)

Thanks, Chris
Reply all
Reply to author
Forward
0 new messages