Skip to content

w-autoheal: opcache-tune must not set validate_timestamps=0 on non-production projects #1

@emyassine

Description

@emyassine

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:
    1. Clears Laravel caches (composer w-cache or artisan sequence)
    2. Resets OPcache via cachetool or kill -USR2 on the FPM master
    3. 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.shopcache-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions