Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Text to speech (PHP) 403 error

We've been using the text-to-speech PHP client for several years now, but the service has suddenly stopped working for some unknown reason (my code remains the same). Our server error log is showing the following message:

PHP Fatal error: Uncaught Google\ApiCore\ApiException: {
"message": "<!DOCTYPE html> ..... Error 403 (Forbidden) .... in /vendor/google/gax/src/ApiException.php on line 139

We are authenticating with a Service Account that looks like this in our PHP script: "putenv(Google_Application_Credentials=XXXX.json);"

This method used to work without issues, but maybe something has changed in the GCP authentication method?

1 2 1,046
2 REPLIES 2