Skip to content
gohacks.dev
Standard Library

php.ini Settings Generator

Generate php.ini overrides for production or development: memory and upload limits, error display, session cookie flags, realpath cache and OPcache tuned to your project size.

Free · No sign-up · Your inputs stay in your browser

Input

Generate php.ini settings

Output

php.ini overrides

632 characters

post_max_size must be larger than upload_max_filesize, because the whole request body counts against it; Nginx's client_max_body_size has to allow it too. With validate_timestamps = 0 PHP never checks files for changes, so every deploy must reload PHP-FPM or reset OPcache. Confirm the values took effect with php -i or phpinfo() under FPM, not the CLI, which reads a different ini.

Runs in this browser. Nothing you paste is sent to a server.

The limits that interact

post_max_size must exceed upload_max_filesize because the whole multipart body counts against it, and Nginx's client_max_body_size must allow the same size or the request never reaches PHP. memory_limit applies per request, so multiply by PHP-FPM's max_children to see the worst case. The php.ini directive list documents each setting.

OPcache in production

With opcache.validate_timestamps=0, PHP never checks whether a file changed, which saves a stat call per included file on every request. It also means a deploy must reload PHP-FPM, or new code is never seen. max_accelerated_files should exceed the number of PHP files including vendor.

Share

Frequently asked questions

Where should these settings go?
In a separate file such as conf.d/99-app.ini for the FPM SAPI, so package upgrades do not overwrite them. The CLI reads its own ini; check with php --ini and phpinfo() under FPM.
Does the PHP JIT make web apps faster?
Rarely by much. Typical web requests spend their time in I/O and framework code that OPcache already speeds up; JIT helps CPU-bound work such as image processing or maths.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools