GuzzleHttp - 主机被阻止

时间:2017-01-16 17:24:40

标签: php curl google-analytics-api guzzle guzzlehttp

我正在我的网络空间安装Google API PHP客户端(2.1.0)和following this tutorial。问题是我去HelloAnalytics.php时遇到PHP错误:

  

致命错误:未捕获的异常   'guzzleHttp \ Ring \ Exception \ ConnectException',消息'cURL错误   6:见http://curl.haxx.se/libcurl/c/libcurl-errors.html'   /reporting_com/google-api-php-client-2.1.0_PHP54/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php:126   堆栈跟踪:#0   /reporting_com/google-api-php-client-2.1.0_PHP54/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php(91):GuzzleHttp \ Ring \ Client \ CurlFactory :: createErrorResponse(Object(GuzzleHttp \ Ring \ Client) \ CurlMultiHandler)   数组,数组)#1   /reporting_com/google-api-php-client-2.1.0_PHP54/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php(244):GuzzleHttp \ Ring \ Client \ CurlFactory :: createResponse(Object(GuzzleHttp \ Ring \ Client) \ CurlMultiHandler)   数组,数组,数组,资源ID#128)#2 / share / src_serv-prd in   /reporting_com/google-api-php-client-2.1.0_PHP54/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php   第49行

GuzzleHttp网站的libcurl-errors.html页面上的第6个错误说:

  

CURLE_COULDNT_RESOLVE_HOST(6)   无法解析主机。给定的远程主机未解析。

这似乎是合法的:我在公司网络上阻止每个卷曲主机。我必须对我的系统管理员说解锁这个主机才能让Curl工作,但我找不到URL主机。

这是什么?

1 个答案:

答案 0 :(得分:0)

要继续其他请求,可以将选项 http_errors 设置为false:

$option = [ 
            ....   
            'http_errors' => false,
            ...
        ];
相关问题