Developer tool
PHP.ini Generator
Generate practical php.ini starting points for development, production, WordPress, uploads, CLI, and API presets.
How it works
What it does
The php.ini Generator builds a starting configuration snippet from presets such as development, production, WordPress-oriented limits, uploads-focused settings, CLI, API, or legacy diagnostics. It emits real directives—memory limits, upload sizes, error display/logging, session cookie flags, and OPcache enablement—ready to adapt to your SAPI.
When to use it
- Standing up a new vhost or container PHP image
- Aligning local Docker PHP with staging limits
- Creating a production baseline that keeps
display_errors=Off - Documenting recommended settings for a team runbook
How input is processed safely
You choose fields and presets; the handler returns text only. It does not write to the server’s real php.ini, does not restart PHP-FPM, and does not inspect other hosted sites. Production presets force safe display settings even if a contradictory choice is requested, with an explicit warning.
Examples
- Production preset with logging on and display off
- Uploads preset raising
upload_max_filesizeandpost_max_sizetogether - API preset with tighter execution time and input limits
Common mistakes
- Editing the wrong ini (CLI vs FPM) and wondering why the site ignored changes
- Raising upload limits without also adjusting web server body size limits
- Enabling
display_errorson public production hosts
PHP reads different ini files depending on SAPI: FPM pools, Apache modules, and CLI binaries often diverge. After generating a snippet, verify the loaded files with php --ini on the same binary that serves the app. Place overrides in the drop-in directory your distribution expects rather than editing distro-managed defaults when possible.
Presets intentionally prefer known-good defaults over exotic tuning. Start conservative, deploy, measure, then adjust. Production mode keeps error display off because leaking paths and queries to end users is a recurring incident pattern.
Upload-oriented presets change size directives together so you do not create impossible combinations. Still remember that Nginx/Apache body limits and reverse proxies can reject requests before PHP sees them—use the upload calculator for the layered view.
Privacy note
Generated ini files rarely need secrets. Do not paste full phpinfo() dumps into related tools—share only the directives you intend to change.
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.