Skip to main content
WPStagingClones
WPStagingClones Partner Disclosure: Outbound /go/ links marked rel="sponsored" may earn a referral commission at zero extra cost (Partner Disclosure).
Stack Matrix Hub (8)

PHP OPcache & Symlink realpath_cache_size Gotchas on Clones

Fix stale PHP class caching and cross-branch file bleed when running multiple WordPress clones on symlinked or shared PHP-FPM pools.

realpath_cache_size=4096K · validate_timestamps=1 · Dedicated pool per branch

PHP OPcache & Symlink realpath_cache_size Gotchas on Clones
Telemetry verified 2026-11-10 by CloneQuota Matrix.

Why Symlinked Staging Deployments Serve Stale PHP Files

When PHP OPcache runs with opcache.validate_timestamps=0 or resolves symlinked docroots through a shared realpath cache, editing functions.php on staging-qa can keep executing cached bytecode from an older release symlink for up to 120 seconds.

Isolating OPcache Keys Across Staging Branches

Keep opcache.validate_timestamps=1 and opcache.revalidate_freq=2 on staging pools, or assign distinct PHP-FPM / LSAPI socket pools per staging subdomain so OPcache memory segments never collide with production.

Measured Thresholds & Configuration

PHP Runtime SettingProduction ValueStaging Clone Value
opcache.validate_timestamps0 (manual flush on deploy)1 (auto-detect QA edits)
opcache.revalidate_freq60s+2s (instant dev feedback)
LSAPI / PHP-FPM PoolIsolated live poolSeparate staging pool + memory cap
realpath_cache_size=4096K · validate_timestamps=1 · Dedicated pool per branch Launch ChemiCloud ($4.49/mo)Hostinger Cloud ($7.99/mo)