Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Coola's avatar
Level 1

Laravel Google App Engine credentials file not found

I have a Laravel application which works fine locally. But when I deploy to Google App Engine (GAE) Standard it cannot locate the storage credentials for Google Cloud Storage (GCS).

Usually this is stored in a json file located in the credentials folder like:

GOOGLE_CLOUD_KEY_FILE="C:/laravelproject/credentials/gcs-credentials.json"

While deploying in my app.yaml I have specified it as:

env_variables:
  GOOGLE_CLOUD_KEY_FILE: "/credentials/gcs-credentials.json"

But I get an error message in the logs as:

PHP Notice: Google\Cloud\Core\Exception\GoogleException: Given keyfile path /credentials/gcs-credentials.json does not exist
 at Google\Cloud\Storage\StorageClient->configureAuthentication (/workspace/vendor/google/cloud-core/src/ClientTrait.php:133) 

I have also tried

env_variables:
  GOOGLE_CLOUD_KEY_FILE: "/tmp/credentials/gcs-credentials.json"

and

env_variables:
  GOOGLE_CLOUD_KEY_FILE: "/credentials/gcs-credentials.json"

and

env_variables:
  GOOGLE_CLOUD_KEY_FILE: "./credentials/gcs-credentials.json"

So my question is how do I specify the gcs credentials file for the GAE Standard environment in my app.yaml?

0 likes
9 replies
laracoft's avatar
laracoft
Best Answer
Level 27

@coola try /workspace/credentials/gcs-credentials.json

1 like
Coola's avatar
Level 1

@laracoft it works, thanks so much was hunting for this for hours. Any idea where in the Google Cloud documentation this is mentioned just for knowledge?

laracoft's avatar

@coola It's there in your error.

PHP Notice: Google\Cloud\Core\Exception\GoogleException: Given keyfile path /credentials/gcs-credentials.json does not exist
 at Google\Cloud\Storage\StorageClient->configureAuthentication (/workspace/vendor/google/cloud-core/src/ClientTrait.php:133) 

Notice how it says /workspace/vendor...

1 like
mk001's avatar

Hi @Coola, I am about to deploy Laravel on Google app engine standard and have a hard time find a way to make it work.

Would you mind sharing docs that you follow to deploy Laravel on GAE? I really appreciate that.

mk001's avatar

@CLab Thanks so much for the speedy reply, are you still using google app engine or move to Heroku / Laravel Vapor now?

CLab's avatar

@mk001 Still using App Engine because its the standard version is cheap/free till your application actually needs to scale up. Also it is quite fast. The main disadvantage of App Engine Standard is that they do not give you the latest PHP version, and no command line control. For example they do not have PHP 8.0 available as yet. And with PHP 7.4 reaching end of life next year we might need to move eventually if they do not provide PHP 8.0 by then. Laravel usually requires PHP versions which are in support so. The good news is that the Google team is working on implementing it, but they never provide exact dates of when things will be available.

1 like
mk001's avatar

@CLab Hopefully, GAE will support php 8.0 soon. It seems quite complicated to deploy Laravel 8 to GAE now, even with the provided link. I am not too sure why not merged into the main branch yet given a lot of review and works has been done

Please or to participate in this conversation.