On this page
OPcache stays on because it is how PHP keeps compiled bytecode ready for the next request. It is not a WordPress plugin, not LSCache, and not Redis. Turning it off to debug one plugin forces every request to recompile every file, so the whole site runs cold until you remember to switch it back.
On shared hosting, MultiPHP and lsphp already enable OPcache for you. Leave it enabled, deploy your changes, and let the cache refresh from file timestamps or a PHP pool reload. Reset OPcache only when you know the cache itself is wrong, and still leave the feature on.
Keep OPcache on and deploy in order
The safe order avoids an outage and avoids a site-wide slowdown you forget to undo. Confirm OPcache is enabled, then ship the files, then reload PHP only if the change is still invisible.
- Confirm OPcache is on, and leave it on.
- Deploy or edit your code. Prefer WP Toolkit or git when timestamps are off, rather than one-off File Manager edits.
- If the edit does not show, reload lsphp or the php-fpm pool. Do not restart the whole web server for a bytecode cache.
- Reset OPcache only when you need a real flush, not as a luck ritual after every change.
php -i | grep opcache.enableYou want opcache.enable On. opcache.enable_cli is usually Off, so CLI and cron behave the way you expect after a deploy. If that binary is not the one LiteSpeed uses for the site, you checked the wrong interpreter. MultiPHP ships several versions, so match the version assigned to the vhost.
Timestamps and File Manager edits
The usual ghost is opcache.validate_timestamps=0 plus an in-place File Manager edit you never see. Some production setups turn timestamps off so PHP does not stat every file on every hit. That is fine when deploys reload PHP. It is confusing when you edit a file and wait for nothing to happen.
Reload the PHP pool, or turn timestamps on while you work, then restore the earlier policy on purpose when you are done. A deploy that touches hundreds of PHP files will miss OPcache until those files compile again. That hitch lasts seconds and is not a reason to leave OPcache off overnight.
When a reset is enough
Resetting OPcache is cheap compared with disabling it. Use a reset when you suspect a corrupted or stuck opcode entry, still with OPcache left enabled. LiteSpeed usually only needs an lsphp recycle or a graceful pool restart.
If a single file will not update after a reload, you are often on the wrong pool or the wrong MultiPHP version. Match the PHP version for the vhost to the pool you restarted, then check the site again.
Tagged
Was this article helpful?
Be the first to rate this article.



