How to Enable OPcache to Speed Up PHP in cPanel
OPcache stores a pre-compiled version of your PHP code in memory, so the server skips re-reading and re-compiling every file on each request — which makes PHP applications like WordPress, Laravel and Joomla noticeably quicker. It is one of the simplest speed wins available, and on VernalWeb you can switch it on yourself.
How OPcache helps
Normally PHP compiles your scripts fresh every time someone visits. OPcache does that work once, keeps the result in memory, and reuses it. The result is faster page generation and lower CPU use — which also helps you avoid resource limit errors.
Step 1: Open the PHP extensions manager
- Log in to cPanel.
- Open Select PHP Version (under the Software section).
- Click the Extensions tab.
Step 2: Enable the OPcache extension
- Find opcache in the list.
- Tick its checkbox to enable it.
- The change saves automatically.
Make sure you are on a modern PHP version while you are here — newer PHP is faster in its own right. See changing your PHP version.
Step 3: Confirm it is working
Create a small file with <?php phpinfo(); ?>, open it in your browser, and search the page for "opcache" — the status should read enabled. Delete the file afterwards so you are not exposing server details. You can also fine-tune settings under the Options tab of Select PHP Version if you need to raise the memory OPcache uses.
Frequently asked questions
Will OPcache break my site?
Very rarely. Occasionally, right after you deploy code changes, OPcache can serve the old version briefly. If that happens, it clears on its own, or you can reset it from the PHP options.
Do I still need a page cache like LiteSpeed?
Yes — they do different jobs. OPcache speeds up PHP execution; a page cache like LiteSpeed Cache skips PHP entirely for cached pages. Use both together for the best results.
Is OPcache the same as Redis?
No. OPcache caches compiled code; Redis caches database query results. They complement each other.
Was this article helpful?