OPcache not invalidated after file changes
Problem
opcache.validate_timestamps=0 is set globally by w-autoheal opcache-tune. This is correct for production but breaks development workflows and any deployment: PHP serves stale compiled bytecode until FPM is manually restarted.
Expected behavior
After any file change (git pull, composer install, artisan command), OPcache should be invalidated and FPM restarted automatically — regardless of whether APP_ENV is production or local.
Proposed fix
w-autoheal opcache-tune should set validate_timestamps based on APP_ENV per pool: 0 for production, 1 for local/staging
- Add a new script
w-deploy (or a --post-deploy flag on w-autoheal) that:
- Clears Laravel caches (
composer w-cache or artisan sequence)
- Resets OPcache via
cachetool or kill -USR2 on the FPM master
- Restarts the relevant
phpX.Y-fpm pool gracefully
- Should detect the correct PHP version per project from the HestiaCP pool config
Affected scripts
w-autoheal.sh — opcache-tune fix
w-perf-report.sh — should warn when validate_timestamps=0 on a project with APP_ENV != production
Environment
- HestiaCP / Debian 12
- PHP 8.4 FPM, multiple pools (one per domain)
- Mixed dev + prod projects on same server
OPcache not invalidated after file changes
Problem
opcache.validate_timestamps=0is set globally byw-autoheal opcache-tune. This is correct for production but breaks development workflows and any deployment: PHP serves stale compiled bytecode until FPM is manually restarted.Expected behavior
After any file change (git pull, composer install, artisan command), OPcache should be invalidated and FPM restarted automatically — regardless of whether
APP_ENVisproductionorlocal.Proposed fix
w-autoheal opcache-tuneshould setvalidate_timestampsbased onAPP_ENVper pool:0for production,1for local/stagingw-deploy(or a--post-deployflag onw-autoheal) that:composer w-cacheor artisan sequence)cachetoolorkill -USR2on the FPM masterphpX.Y-fpmpool gracefullyAffected scripts
w-autoheal.sh—opcache-tunefixw-perf-report.sh— should warn whenvalidate_timestamps=0on a project withAPP_ENV != productionEnvironment