ValDiMagra
ValDiMagra

Reputation: 93

Uncaught exception InvalidArgumentException with message Config file not found as specified: adsapi_php.ini - Google Adwords API

The problem is about the Google Adwords API with the new library 201609. I'm getting an error when I run the code:

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.

I was using library 201607 on my Google Adwords project and everything was fine. So I've already done the API manager side things on Google and although everyone who uses it gets ass cancer I've installed and set files up with composer. I've tried to search Google and Stack Overflow documents to find a solution, but documents and site was not enough.

I am guessing that the adsapi_php.ini is not on the correct place, but I couldn't find the right place and a file to edit to show the correct path. What am I dealing with?

I've already done:

Upvotes: 3

Views: 4438

Answers (2)

Thanet Praneenararat
Thanet Praneenararat

Reputation: 51

Glad to hear that you can find the solution by yourself. :)

As you can figure out, the getting started steps are listed here.

If you have problems with using Google Ads PHP client library in the future, feel free to open an issue in the issues page.

For questions about AdWords API, I recommend to post your questions at AdWords API forum. There are people who moderate the forum actively.

Best,

Thanet, AdWords API Team

Upvotes: 0

ValDiMagra
ValDiMagra

Reputation: 93

Found the solution by myself. Hope this will help someone else.

On GitHub they already mentioned that:

All our examples are meant to be run via the command line and not as a webpage.

So examples must be run on shell.

Edit:

With a little luck I've found a solution here its steps:

  1. First you have to build that via composer. Let me say you installed it in public_html/googleapi/
  2. Download and extract files from GitHub to your /googleapi directory
  3. There must be now "vendor", "examples", "src" folders and "composer.*" files in that directory.
  4. "examples" directory has no use for YOUR project you can keep or delete it
  5. After editing your "adsapi_php.ini" file you must copy it to your home (/googleapi) directory.
  6. Creat a file "test.php" with example codes.
  7. Copy "test.php" to your home directory too.
  8. You must edit your example code for "autoload.php" usually on line 2. That file is in /googleapi/vendor/.

Hope this helps.

Upvotes: 5

Related Questions