Google Adwords:配置未正确加载 [英] Google Adwords: Configuration Not Loading Properly

查看:65
本文介绍了Google Adwords:配置未正确加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注本教程: https: //developers.google.com/adwords/api/docs/guides/first-api-call#make_your_first_api_call_1

我正在链接到该步骤.当我进入终端并运行php

And I'm at that step I linked. When I go into terminal and run php

path/to/GetCampaigns.php会返回此错误:`PHP致命错误:未捕获的异常'Google \ AdsApi \ AdWords \ v201609 \ cm \ ApiException',消息为[QuotaCheckError.INVALID_TOKEN_HEADER @;在/var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:39

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文件,这在主教程中建议:

I assume that it is not finding my adsapi_php.ini file that I set up through this, which was suggested in the main tutorial: https://github.com/googleads/googleads-php-lib

如果我改用浏览器并尝试访问该页面,然后返回到我的日志,它将在日志中返回此错误:

If I go to browser instead and try to access the page, and then return to my logs, it returns this error in logs:

[2016年12月28日星期三12:25:52] [错误] [客户端70.162.15.23]致命错误:未捕获的异常'InvalidArgumentException'和消息'未按指定找到配置文件:'adsapi_php.ini'.找不到主目录,因此未搜索到.在/var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php:71\nStack跟踪:\ 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抛出在第71行的/var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php中

[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

如果我错过任何事情,请告诉我.

If I'm missing anything let me know.

推荐答案

似乎在一周之内,文档发生了变化,并且我在关注两种不同版本的文档.我需要做的就是重新生成开发人员令牌并更新我的.ini文件.现在一切正常.

It seems within the week, documentation has changed, and I was following two different versions of the documentation. All I needed to do was regenerate the developer token and update my .ini file. Everything is working fine now.

这篇关于Google Adwords:配置未正确加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆