My issue is simply that I want to be able to use google talents solutions API, create a mock couple of jobs and companies and use them to perform dummy searches on. I'm using PHP which is also very new to me and can't at the moment use anything else for implementation unless it works with PHP. My code for creating a company for instance works fine hardcoded in PHP, and returns a success message, but if I want to use a html/php form to do it. I get the following error on form submit:
Fatal error: Uncaught DomainException: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information in /Users/shaun/Sites/gts/vendor/google/auth/src/ApplicationDefaultCredentials.php:168
Stack trace:
#0 /Users/shaun/Sites/gts/vendor/google/gax/src/CredentialsWrapper.php(197): Google\Auth\ApplicationDefaultCredentials::getCredentials(Array, Object(Google\Auth\HttpHandler\Guzzle6HttpHandler), NULL, NULL)
#1 /Users/shaun/Sites/gts/vendor/google/gax/src/CredentialsWrapper.php(114): Google\ApiCore\CredentialsWrapper::buildApplicationDefaultCredentials(Array, Object(Google\Auth\HttpHandler\Guzzle6HttpHandler))
#2 /Users/shaun/Sites/gts/vendor/google/gax/src/GapicClientTrait.php(339): Google\ApiCore\CredentialsWrapper::build(Array)
#3 /Users/shaun/Sites/gts/vendor/google/gax/src/GapicClientTrait.php(321): Google\Cloud\Talent\V4beta1\Gapic\CompanyServiceGapicClient->createCredentialsWrapper(NULL, Array)
#4 /Users/shaun/Sites/gts/vendor/google/cl in /Users/shaun/Sites/gts/vendor/google/gax/src/CredentialsWrapper.php on line 200
Any help on how I can enable the credentials would be much appreciated. I have tried export credentials to relative .json on terminal and coding in a global variable in the php. So far no luck, although maybe I'm doing it wrong.
I have also authorized the domain 'lvh.me'.
Issue resolved, was not using putenv() variable like so:
putenv("GOOGLE_APPLICATION_CREDENTIALS=" . $GOOGLE_APPLICATION_CREDENTIALS);