You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress在IIS 7服务器搭配PHP 7时崩溃问题求助

Troubleshooting the WordPress PHP Fatal Error on IIS 7 + PHP 7

Hey there, let's work through this issue—this kind of delayed crash with a core file not found error is tricky, but it's usually tied to either permissions, caching, or IIS-specific configuration quirks. Here's what I'd check step by step:

  • First, verify the file actually exists (and isn't corrupted)
    Even though it's a core WordPress file, it's worth double-checking: navigate to \wp-admin\includes\ on your server and confirm class-wp-site-icon.php is present. If it's missing or looks truncated, download a fresh copy of your exact WordPress version, extract the /wp-admin/includes/ folder, and overwrite the existing one (this won't touch your custom themes or plugins).

  • Check IIS file permissions for the PHP process
    IIS runs PHP under the IIS_IUSRS group by default. Make sure this group has read & execute permissions for the entire WordPress directory, especially /wp-admin/includes/. Sometimes after long uptime, temporary permission glitches can block file access—reapplying permissions (and ensuring inheritance is enabled) can fix this. Also, check if your IIS application pool has "Load User Profile" enabled (in the application pool's Advanced Settings)—disabling this can cause permission-related file access issues.

  • Tweak PHP OPcache settings
    PHP 7 relies heavily on OPcache for performance, but misconfigured caching can mark core files as missing after extended runtime. Open your php.ini and adjust these settings:

    • Set opcache.validate_timestamps = 1 (this makes PHP check if files have changed instead of relying on cached data indefinitely)
    • Lower opcache.revalidate_freq to something like 60 (checks for file changes every 60 seconds instead of the default longer interval)
    • Restart your IIS application pool after making changes to apply the new settings.
  • Configure IIS Application Pool recycling
    IIS application pools can develop resource leaks or path-related glitches after hours of runtime. Set up a regular recycle schedule (e.g., every 2 hours) in the application pool's Recycling settings. You can also enable "Recycle worker processes (in minutes)" and set it to 120—this prevents the pool from running too long without a fresh start, which often resolves intermittent file access errors.

  • Check FastCGI configuration in IIS
    If you're using PHP via FastCGI (the recommended setup for IIS), verify these settings:

    • Ensure "Maximum requests per instance" isn't set too high—this limits how many requests a single PHP process handles before restarting, preventing memory leaks that could cause file access failures.
    • Set "Request timeout" to a reasonable value (e.g., 300 seconds) to avoid premature process termination.

Quick test: When the error happens next, try restarting your IIS application pool immediately. If the site starts working again, that confirms the issue is tied to long-running processes or cached state—pointing you toward the OPcache or application pool recycling fixes.

内容的提问来源于stack exchange,提问作者virs90

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:24:31