简体   繁体   English

PHP的CURL版本支持

[英]CURL Version support on PHP

I am having issues with the twitter API and getting error: 我在twitter API上遇到问题并收到错误消息:

Error: "SSL connect error" - Code: 35 错误:“ SSL连接错误”-代码:35

I have seen that this could be an cURL version issue and need to update. 我已经看到这可能是cURL版本问题,需要更新。

Currently we have version 7.19.7, I believe we need to go to at least 7.42 (latest is 7.65.3) 当前我们有7.19.7版本,我认为我们至少需要降到7.42(最新为7.65.3)

We have php version 5.6.31, does anyone know if these are supported or if there are any issues upgrading? 我们的PHP版本为5.6.31,有人知道这些功能是否受支持,或者升级是否存在任何问题?

Cant find any supported platform info anywhere. 无法在任何地方找到任何受支持的平台信息。

We are using TwitterOAuth: 我们正在使用TwitterOAuth:

Config call as follows: 配置调用如下:

function http($url, $method, $postfields = NULL) {
    $this->http_info = array();
    $ci = curl_init();
    /* Curl settings */
    curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);
    curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
    curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);
    curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));
    curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
    curl_setopt($ci, CURLOPT_HEADER, FALSE);

    curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ci, CURLOPT_SSLVERSION,1); 

I had a similar problem and i solved it withe this changes in my Curl call. 我有一个类似的问题,我通过Curl调用中的此更改解决了。

  • Change CURLOPT_SSL_VERIFYPEER to false 将CURLOPT_SSL_VERIFYPEER更改为false
  • Change CURLOPT_SSL_VERIFYHOST to false 将CURLOPT_SSL_VERIFYHOST更改为false
  • Change CURLOPT_SSLVERSION to 1, or the version that the server uses. 将CURLOPT_SSLVERSION更改为1或服务器使用的版本。

Anyway, it would be helpful to be able to see the call you're making. 无论如何,能够看到正在拨打的电话会很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM