WordPress在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 confirmclass-wp-site-icon.phpis 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 theIIS_IUSRSgroup 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 yourphp.iniand 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_freqto something like60(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.
- Set
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

