Google Api Php客户端-cURL错误6:无法解析主机: [英] Google Api Php Client - cURL error 6: Could not resolve host:

查看:66
本文介绍了Google Api Php客户端-cURL错误6:无法解析主机:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google APi PHP客户端从我的Android应用程序验证Google Play登录名.服务无处不在停止工作,并给我这个错误.

i'm using the Google APi PHP Client to verfiy Google Play Logins from my Android Application. Out of nowhere the service stopped working and gives me this error.

致命错误>:未捕获的异常信息为"cURL错误6"的"GuzzleHttp \ Exception \ ConnectException":无法解析主机:www.googleapis.com(请参阅 http://curl.haxx.se/libcurl/c/libcurl-errors.html )"/var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186堆栈跟踪:0/var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150):GuzzleHttp \ Handler \ CurlFactory:: createRejection(Object(GuzzleHttp \ Handler \ EasyHandle),大批)1/var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103):GuzzleHttp \ Handler \ CurlFactory:: finishError(Object(GuzzleHttp \ Handler \ CurlHandler),对象(GuzzleHttp \ Handler \ EasyHandle),对象(GuzzleHttp \ Handler \ CurlFactory)2/var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43):GuzzleHttp \ Handler \ CurlFactory :: finish(Object(in/var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php在 186

Fatal error>: Uncaught exception 'GuzzleHttp\Exception\ConnectException' with message 'cURL error 6: Could not resolve host: www.googleapis.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in /var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186 Stack trace: 0 /var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) 1 /var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) 2 /var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object( in /var/www/vhosts/smokah.one/api.smokah.one/csgo/google-api-php-client/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186

它无处不在.

真诚的伊莱亚斯

推荐答案

您可以尝试以下选项:

  1. 检查您的ssl证书,它可能配置不正确.您可以尝试从php.ini

  1. Check your ssl certificate, It might not configured proper. You can try once commenting the extension=curl.so line from from your php.ini

确保托管服务器应该能够通过google服务网址(如果被阻止)来ping通google网站.

Make sure the hosted server should be able to ping to google websites, by pass the google service url if blocked.

如果您进行了与服务器配置有关的任何更改,请重新启动php-fpm服务.

Restart the php-fpm service if you made any changes related to server configuration.

在我的情况下,第二个选项有效,每次我需要远程登录服务器并需要启动Internet作为代理时.

In my case 2nd options worked, Every time I need to login to my server remotely and needs to start internet as proxy is there.

让我知道以上任何一种解决方案是否对您有用.

Let me know if any of above solutions worked for you.

谢谢!

这篇关于Google Api Php客户端-cURL错误6:无法解析主机:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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