{
  "id": "php/opcache-interned-strings-buffer-overflow",
  "signature": "Warning: PHP Startup: Unable to allocate memory for interned strings buffer in Unknown on line 0",
  "signature_zh": "警告：PHP启动：无法为驻留字符串缓冲区分配内存，位置未知，行0",
  "regex": "/Warning: PHP Startup: Unable to allocate memory for interned strings buffer/",
  "domain": "php",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "The opcache.interned_strings_buffer setting is too large for the available memory, or the actual interned strings usage exceeds the allocated buffer size, causing PHP to fail during startup.",
  "root_cause_type": "generic",
  "root_cause_zh": "opcache.interned_strings_buffer设置过大，超出可用内存，或实际驻留字符串使用量超过分配的缓冲区大小，导致PHP启动时失败。",
  "versions": [
    {
      "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": "PHP 8.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing the buffer without addressing memory constraints may cause the system to run out of memory entirely, leading to OOM kills or swap thrashing.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling OPcache removes performance benefits and may mask the issue; interned strings buffer warnings may still appear if the setting is misconfigured.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Simply restarting does not resolve the underlying memory allocation issue; the warning will reappear on the next startup.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce opcache.interned_strings_buffer to a lower value, e.g., from 16 to 8 or 4 in php.ini, then restart PHP-FPM.",
      "success_rate": 0.7,
      "how": "Reduce opcache.interned_strings_buffer to a lower value, e.g., from 16 to 8 or 4 in php.ini, then restart PHP-FPM.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase system memory or adjust kernel parameters (e.g., vm.overcommit_memory) to allow larger allocations. On Linux, run: sudo sysctl -w vm.overcommit_memory=1",
      "success_rate": 0.8,
      "how": "Increase system memory or adjust kernel parameters (e.g., vm.overcommit_memory) to allow larger allocations. On Linux, run: sudo sysctl -w vm.overcommit_memory=1",
      "condition": "",
      "sources": []
    },
    {
      "action": "Monitor actual interned strings usage with opcache_get_status() and set the buffer to a value slightly above peak usage. Example: $status = opcache_get_status(false); echo $status['interned_strings_usage']['used_memory'];",
      "success_rate": 0.85,
      "how": "Monitor actual interned strings usage with opcache_get_status() and set the buffer to a value slightly above peak usage. Example: $status = opcache_get_status(false); echo $status['interned_strings_usage']['used_memory'];",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Reduce opcache.interned_strings_buffer to a lower value, e.g., from 16 to 8 or 4 in php.ini, then restart PHP-FPM.",
    "Increase system memory or adjust kernel parameters (e.g., vm.overcommit_memory) to allow larger allocations. On Linux, run: sudo sysctl -w vm.overcommit_memory=1",
    "Monitor actual interned strings usage with opcache_get_status() and set the buffer to a value slightly above peak usage. Example: $status = opcache_get_status(false); echo $status['interned_strings_usage']['used_memory'];"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.interned-strings-buffer",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}