googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
288 stars 260 forks source link

GenerateUserCredentials does not work with react/http installed #967

Closed wanderlusted18 closed 10 months ago

wanderlusted18 commented 10 months ago

I´d like to use the google-ads-php library as a part of my Laravel project. I follow the instructions in the README.md file, however when I try to run the examples/Authentication/GenerateUserCredentials.php script to get my refresh token, I get the following error message:

Please install "react/http" package to be able to run this example%

I tried to fix this by installing this dependency:

composer require react/http

but I still get the same error message.

Please note that I had to comment out line 21 (require DIR . '/../../vendor/autoload.php';) of the same file, as this file does not exist in my project (and I think not needed either in a Laravel project).

Please advise how to fix this problem.

Thanks, W.

wanderlusted18 commented 10 months ago

For some reason the above composer command did not download the latest version of react/http, therefore GenerateUserCredentials could not find the right classes. I had to use the below composer command to get the latest version and now I could get my refresh token without any problems: composer require react/http:^1.9 -W