{
  "id": "php/opcache-invalid-file",
  "signature": "Warning: Opcache: Cannot revalidate file '/var/www/app/index.php' - stat failed in Unknown on line 0",
  "signature_zh": "警告: Opcache: 无法重新验证文件 '/var/www/app/index.php' - stat 失败，位于 Unknown 第 0 行",
  "regex": "Warning: Opcache: Cannot revalidate file '.*' - stat failed in Unknown on line 0",
  "domain": "php",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "OPcache cannot stat a cached PHP file because the file was deleted, moved, or its permissions changed after being cached, causing a stale cache entry.",
  "root_cause_type": "generic",
  "root_cause_zh": "OPcache 无法 stat 一个已缓存的 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": "Disabling OPcache entirely (opcache.enable=0) fixes the warning but causes significant performance loss; it's an overreaction for a file management issue.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Simply restarting PHP-FPM without clearing the cache may not help if the file is still missing; the cache entry persists in shared memory.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Clear the OPcache by restarting the web server (e.g., 'sudo systemctl restart php8.2-fpm') or using a function like opcache_reset() in a script.",
      "success_rate": 0.9,
      "how": "Clear the OPcache by restarting the web server (e.g., 'sudo systemctl restart php8.2-fpm') or using a function like opcache_reset() in a script.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set opcache.validate_timestamps=1 and opcache.revalidate_freq=0 in php.ini to check file changes on every request, preventing stale entries.",
      "success_rate": 0.85,
      "how": "Set opcache.validate_timestamps=1 and opcache.revalidate_freq=0 in php.ini to check file changes on every request, preventing stale entries.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure the file exists and has correct permissions: run 'ls -la /var/www/app/index.php' and 'chmod 644 /var/www/app/index.php' if needed.",
      "success_rate": 0.95,
      "how": "Ensure the file exists and has correct permissions: run 'ls -la /var/www/app/index.php' and 'chmod 644 /var/www/app/index.php' if needed.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Clear the OPcache by restarting the web server (e.g., 'sudo systemctl restart php8.2-fpm') or using a function like opcache_reset() in a script.",
    "Set opcache.validate_timestamps=1 and opcache.revalidate_freq=0 in php.ini to check file changes on every request, preventing stale entries.",
    "Ensure the file exists and has correct permissions: run 'ls -la /var/www/app/index.php' and 'chmod 644 /var/www/app/index.php' if needed."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}