I found that the proxy set in the config file doesn't really work, because 
some requests (e.g. request oauth2) don't use the proxy, you have to set 
the global proxy to solve this problem, which causes a new problem that 
setting the global proxy affects other requests in the application. 
Hopefully this will be fixed in a future version of the google-ads-php 
library!

Now I solve the problem temporarily with this method:
$_SERVER['HTTP_PROXY'] = 'http://127.0.0.1:7789';
$_SERVER['HTTPS_PROXY'] = 'http://127.0.0.1:7789';
On Thursday, 18 May 2023 at 18:53:53 UTC+8 2022 Tony wrote:

> My google php library can't request data through a proxy, but the python 
> version can. I'm sure my proxy is working, is there somewhere in the php 
> library where I forgot to set the proxy?
> This error is prompted:
> Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 
> 35: OpenSSL SSL_connect: Connection was reset in connection to 
> oauth2.googleapis.com:443  (see 
> https://curl.haxx.se/libcurl/c/libcurl-errors.html) for 
> https://oauth2.googleapis.com/token in 
> E:\wwwroot\google-ads-php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:210
> Stack trace:
> #0 
> E:\wwwroot\google-ads-php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(158):
>  
> GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle),
>  
> Array)
> #1 
> E:\wwwroot\google-ads-php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(110):
>  
> GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler),
>  
> Object(GuzzleHttp\Handler\EasyHandle), 
> Object(GuzzleHttp\Handler\CurlFactory))
> #2 
> E:\wwwroot\google-ads-php\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(47):
>  
> GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler),
>  
> Object(GuzzleHttp\Handler\EasyHandle), 
> Object(GuzzleHttp\Handler\CurlFactory))
> # in 
> E:\wwwroot\google-ads-php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php
>  
> on line 210
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/76ba0755-bacd-4195-a3c7-285f96971285n%40googlegroups.com.
  • Go... 2022 Tony
    • ... 2022 Tony
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to