{
  "id": "php/guzzle-http-version-not-supported",
  "signature": "GuzzleHttp\\Exception\\ConnectException: cURL error 1: Protocol \"http2\" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:187",
  "signature_zh": "GuzzleHttp\\Exception\\ConnectException：cURL 错误 1：协议 \"http2\" 不受支持或在 libcurl 中被禁用（请参阅 https://curl.haxx.se/libcurl/c/libcurl-errors.html），位于 /var/www/app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:187",
  "regex": "/cURL error 1: Protocol \"http2\" not supported or disabled in libcurl/",
  "domain": "php",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "The installed libcurl version does not support HTTP/2, but the Guzzle client is configured to use 'http2' as the protocol version.",
  "root_cause_type": "generic",
  "root_cause_zh": "安装的 libcurl 版本不支持 HTTP/2，但 Guzzle 客户端被配置为使用 'http2' 作为协议版本。",
  "versions": [
    {
      "version": "Guzzle 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Guzzle 7.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PHP 8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting CURLOPT_HTTP_VERSION to CURL_HTTP_VERSION_2_0 manually in a custom handler",
      "why_fails": "This does not fix the underlying libcurl limitation; it just changes the constant used, but libcurl still cannot negotiate HTTP/2.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinstalling PHP and cURL extension via apt-get without checking the libcurl version",
      "why_fails": "The default system libcurl on older OS versions may still lack HTTP/2 support; you need to ensure the libcurl-dev package is from a version that supports HTTP/2 (e.g., >= 7.50.0).",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Downgrade the Guzzle client to use HTTP/1.1 instead: `$client = new GuzzleHttp\\Client(['version' => '1.1']);`",
      "success_rate": 0.9,
      "how": "Downgrade the Guzzle client to use HTTP/1.1 instead: `$client = new GuzzleHttp\\Client(['version' => '1.1']);`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade libcurl to a version that supports HTTP/2. On Ubuntu/Debian: `sudo apt-get update && sudo apt-get install --only-upgrade libcurl4-openssl-dev` and then recompile PHP's cURL extension. Verify with `php -i | grep cURL` and check 'cURL Information' for HTTP2 support.",
      "success_rate": 0.75,
      "how": "Upgrade libcurl to a version that supports HTTP/2. On Ubuntu/Debian: `sudo apt-get update && sudo apt-get install --only-upgrade libcurl4-openssl-dev` and then recompile PHP's cURL extension. Verify with `php -i | grep cURL` and check 'cURL Information' for HTTP2 support.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Downgrade the Guzzle client to use HTTP/1.1 instead: `$client = new GuzzleHttp\\Client(['version' => '1.1']);`",
    "Upgrade libcurl to a version that supports HTTP/2. On Ubuntu/Debian: `sudo apt-get update && sudo apt-get install --only-upgrade libcurl4-openssl-dev` and then recompile PHP's cURL extension. Verify with `php -i | grep cURL` and check 'cURL Information' for HTTP2 support."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.guzzlephp.org/en/stable/request-options.html#version",
  "official_doc_section": null,
  "error_code": "1",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}