PHP settings
Set a PHP website's largest upload, memory per request, longest run time, form fields and PHP workers, written to its own PHP-FPM pool.
Each PHP website runs in its own PHP-FPM pool, so its PHP limits can differ from other sites on the same server. Set them in the PHP settings card on the website's Settings tab.
The settings
| Setting | Range | Default | What it sets |
|---|---|---|---|
| Largest upload (MB) | 1 to 2048 | 64 | upload_max_filesize and post_max_size, and NGINX's client_max_body_size for the site. The biggest file a form or the media library takes. |
| Memory per request (MB) | 32 to 4096 | 128 | memory_limit: how much memory one page load may use. |
| Longest run time (seconds) | 5 to 3600 | 30 | max_execution_time and max_input_time. After this a page load is stopped. Imports and backups may need more. |
| Form fields | 100 to 100000 | 1000 | max_input_vars. Large menus and page builders need more than 1000. |
| PHP workers | 1 to 100 | 10 | pm.max_children: page loads the site answers at the same time. Each one can use the memory above. |
The defaults are what every PHP website had before these settings existed.
Change them
- Open the PHP website and go to the Settings tab.
- In the PHP settings card, change the values, or click Recommended for WordPress to fill in values that suit most WordPress and WooCommerce sites (128 MB upload, 256 MB memory, 120 seconds, 3000 form fields, 10 workers).
- Click Save and apply.
Reset to defaults fills in the defaults again; click Save and apply to use them.
The agent writes the values into the site's PHP-FPM pool, and the upload size into the site's NGINX configuration, then tests both with php-fpm -t and nginx -t before they apply. If a test fails, the site keeps its previous settings.
Copies of a website
Clones and staging copies keep the PHP settings of the website they copy. Switching the site's PHP version keeps them too.
Related
- PHP versions to choose the PHP version a site runs.
- Caching to answer more visitors without more workers.
- API reference for the
phpSettingsfield.