2016-12-28 111 views
0

我正在关注本教程:https://developers.google.com/adwords/api/docs/guides/first-api-call#make_your_first_api_call_1谷歌Adwords:配置不正确加载

而我在那一步我链接。当我进入终端和运行PHP

path/to/GetCampaigns.php it returns this error: `PHP Fatal error: Uncaught exception 'Google\AdsApi\AdWords\v201609\cm\ApiException' with message '[QuotaCheckError.INVALID_TOKEN_HEADER @ ; trigger:'_dev_token_']' in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:39

我认为它没有发现我设置通过这个我adsapi_php.ini文件,这是在主要教程提示:https://github.com/googleads/googleads-php-lib

如果我去到浏览器,而不是和尝试访问该页面,然后回到我的日志,它记录中返回此错误:

[Wed Dec 28 12:25:52 2016] [error] [client 70.162.15.23] PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Config file not found as specified: 'adsapi_php.ini'. Home directory could not be located so it was not searched.' in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php:71\nStack trace:\n#0 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php(51): Google\AdsApi\Common\ConfigurationLoader->fromFile('adsapi_php.ini')\n#1 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/BasicOperations/GetCampaigns.php(76): Google\AdsApi\Common\OAuth2TokenBuilder->fromFile()\n#2 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/BasicOperations/GetCampaigns.php(89): Google\AdsApi\Examples\AdWords\v201609\BasicOperations\GetCampaigns::main()\n#3 {main}\n thrown in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php on line 71

如果我错过了什么让我知道。

回答

0

看来在一周内,文档已经改变了,而且我正在关注两个不同版本的文档。我需要做的是重新生成开发人员令牌并更新我的.ini文件。现在一切正常。