【问题标题】:cURL 错误 28:5001 毫秒后解析超时
【发布时间】:2017-10-20 08:07:31
【问题描述】:

我使用 WordPress,我最近将我的网站从 cpanel 主机移到了带有 directadmin 面板的 Linux 服务器。 刚转账后发现客户通过EDD插件下载时出现如下错误。

cURL 错误 28:5001 毫秒后解析超时

我也收到了 w3_total_cache 插件的这个错误。

服务器信息: Centos 6.8(最终版) cURL 7.54.0(最终版) 直接管理员

【问题讨论】:

    标签: php linux curl centos directadmin


    【解决方案1】:

    cURL error 28: Resolving timed out after 5001 milliseconds 表示 DNS resolving failed

    所以只需更改 /etc/resolv.conf 中的 DNS 服务器列表。

    或者我们可以在/etc/hosts中绑定主机名和IP地址。

    这张图片展示了演示。

    【讨论】:

      【解决方案2】:

      据报道: https://wordpress.org/support/topic/dropbox-upload-fails-with-curl-timeout-error/ 您可以应用此临时修复来延长 HTTP 请求超时:

      add_filter( 'http_request_timeout', function( $timeout ) { return 60; });
      

      Wordpress 默认为 5 秒。

      【讨论】:

        【解决方案3】:

        要解决此问题,您必须在 curl 初始化时设置 curl 连接超时和超时值。
        只需更改这两个属性值即可。

        CURLOPT_CONNECTTIMEOUT => 30,
        CURLOPT_TIMEOUT => 60,
        

        更多详情请查看This

        【讨论】:

          【解决方案4】:

          在此处更新这两行: /usr/share/icingaweb2/modules/jira/library/Jira/RestApi.php

              $opts = array(
                  CURLOPT_URL            => $this->url($url),
                  CURLOPT_HTTPHEADER     => $headers,
                  CURLOPT_USERPWD        => $auth,
                  CURLOPT_CUSTOMREQUEST  => \strtoupper($method),
                  CURLOPT_RETURNTRANSFER => true,
                  CURLOPT_CONNECTTIMEOUT => 30,
                  CURLOPT_TIMEOUT => 30,
          

          【讨论】:

            【解决方案5】:

            你可以设置 set_time_limit(120);MySQL 设置 部分之后的 wp-config.php 中。

            【讨论】:

              猜你喜欢
              • 2017-07-27
              • 1970-01-01
              • 1970-01-01
              • 2017-05-18
              • 2023-01-03
              • 2020-08-12
              • 2020-09-07
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多