我遵循本教程:https://developers.google.com/adwords/api/docs/guides/first-api-call#make_your_first_api_call_1
我在那一步联系了。当我进入终端并运行php
path / to / GetCampaigns.php它会返回以下错误:`PHP致命错误:未捕获的异常' Google \ AdsApi \ AdWords \ v201609 \ cm \ ApiException'消息' [QuotaCheckError.INVALID_TOKEN_HEADER @;触发:' _dev_token _']'在/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] [错误] [client 70.162.15.23] PHP致命错误:未捕获异常' InvalidArgumentException'邮件'未按指定找到配置文件:' adsapi_php.ini'。无法找到主目录,因此未对其进行搜索。'在/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#第7行的/var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php中提出了3个{main} \ n
如果我遗失了什么,请告诉我。
答案 0 :(得分:0)
似乎在一周内,文档发生了变化,我正在关注两个不同版本的文档。我需要做的就是重新生成开发人员令牌并更新我的.ini文件。现在一切都很好。