{
  "id": "php/soap-wsdl-http-error",
  "signature": "SoapFault exception: [HTTP] Error Fetching http headers in /var/www/app/src/Integrations/SoapClient.php:25",
  "signature_zh": "SoapFault 异常：[HTTP] 获取 http 头时出错，位于 /var/www/app/src/Integrations/SoapClient.php 第 25 行",
  "regex": "SoapFault exception: \\[HTTP\\] Error Fetching http headers in .* on line \\d+",
  "domain": "php",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The SOAP client failed to receive HTTP response headers from the remote server, often due to network timeout, proxy misconfiguration, or the server closing the connection prematurely.",
  "root_cause_type": "generic",
  "root_cause_zh": "SOAP 客户端未能从远程服务器接收到 HTTP 响应头，通常是由于网络超时、代理配置错误或服务器提前关闭连接。",
  "versions": [
    {
      "version": "PHP 8.0",
      "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"
    },
    {
      "version": "libxml2 2.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "libxml2 2.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The SOAP client uses its own timeout settings (default_socket_timeout) which are independent of max_execution_time.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error occurs during the actual SOAP call, not during WSDL loading.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The extension is functional; the issue is external network connectivity.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the SOAP client timeout by setting 'connection_timeout' and 'default_socket_timeout' in the stream context: `$context = stream_context_create(['http' => ['timeout' => 30]]); $client = new SoapClient($wsdl, ['stream_context' => $context]);`",
      "success_rate": 0.8,
      "how": "Increase the SOAP client timeout by setting 'connection_timeout' and 'default_socket_timeout' in the stream context: `$context = stream_context_create(['http' => ['timeout' => 30]]); $client = new SoapClient($wsdl, ['stream_context' => $context]);`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Configure a proxy in the SOAP client options if behind a corporate firewall: `$client = new SoapClient($wsdl, ['proxy_host' => 'proxy.example.com', 'proxy_port' => 8080]);`",
      "success_rate": 0.85,
      "how": "Configure a proxy in the SOAP client options if behind a corporate firewall: `$client = new SoapClient($wsdl, ['proxy_host' => 'proxy.example.com', 'proxy_port' => 8080]);`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `file_get_contents()` with a stream context to test basic connectivity to the SOAP endpoint before initializing the client; log the response headers for debugging.",
      "success_rate": 0.7,
      "how": "Use `file_get_contents()` with a stream context to test basic connectivity to the SOAP endpoint before initializing the client; log the response headers for debugging.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过在流上下文中设置 'connection_timeout' 和 'default_socket_timeout' 来增加 SOAP 客户端超时：`$context = stream_context_create(['http' => ['timeout' => 30]]); $client = new SoapClient($wsdl, ['stream_context' => $context]);`",
    "如果在公司防火墙后，在 SOAP 客户端选项中配置代理：`$client = new SoapClient($wsdl, ['proxy_host' => 'proxy.example.com', 'proxy_port' => 8080]);`",
    "在初始化客户端之前，使用带流上下文的 `file_get_contents()` 测试与 SOAP 端点的基本连接；记录响应头以进行调试。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.php.net/manual/en/soapclient.soapclient.php",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.78,
  "resolvable": "partial",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}