Developer tool
OPcache Config Generator
Suggest a conservative OPcache starting configuration from host RAM and workload hints.
How it works
What it does
The OPcache Config Generator proposes a conservative starting opcache.ini based on host hints such as available RAM and workload style. It is explicitly a starting point—not a claim of a perfect production tune for every application.
When to use it
- Enabling OPcache on a new PHP-FPM pool
- Replacing cargo-cult copy/paste from outdated blog posts
- Preparing values before validating with
opcache_get_status()on the target SAPI
How input is processed safely
Only numeric/text hints are accepted. The tool returns configuration text for download/copy. It does not restart PHP, does not read other vhosts’ status, and does not invent non-existent directives.
Examples
- Small VPS shared among few apps → modest
memory_consumption - Larger dedicated app server → higher interned strings and max accelerated files
- Reminders to disable risky revalidate settings in production without a deploy strategy
Common mistakes
- Copying huge cache sizes onto tiny hosts until the OOM killer appears
- Forgetting CLI and FPM have separate SAPIs/configs
- Never measuring hit rates after deployment
OPcache stores compiled opcodes so PHP does not recompile scripts on every request. Undersized caches thrash; oversized caches waste RAM that FPM workers could use. Interned strings and max accelerated files matter on large frameworks with thousands of PHP files.
After applying a generated starting point, inspect opcache_get_status() (through a protected admin script) on the correct SAPI. Watch hit rate, cached scripts, and memory usage over a realistic traffic window—not only immediately after deploy.
Avoid enabling dangerous validate timestamps settings in production without a coordinated deploy strategy. Stale code after release is a common cause of “I deployed but nothing changed” incidents.
Practical tips
- Keep inputs small and representative; huge pastes slow feedback and raise risk of accidental secret disclosure.
- After using OPcache Config Generator, verify the result in your own environment (correct SAPI, correct host, correct project root).
- Cross-link findings to ZendStudio.net PHP error guides and IDE setup pages when the next step is configuration rather than code edits.
- Prefer repeatable project tooling (CI, Composer scripts, IDE inspections) for repo-wide enforcement; this page is for interactive problem-solving.
Privacy note
No application source is required. Avoid pasting full production phpinfo output when gathering RAM figures—use admin metrics instead.
Run in browser
AJAX processing only. No remote PHP execution sandbox. Results are not indexed.
Safety notes
- Submitted tool contents are not written to analytics or search logs.
- This site never evaluates arbitrary PHP from the browser.
- Generated configs are starting points—validate on a staging host before production.