# PHP settings

URL: https://docs.vaultpanel.net/guides/websites/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.

> **Note:**
Changing PHP settings needs agent 0.43.0 or later on the website's server.

## 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

1. Open the PHP website and go to the **Settings** tab.
2. 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).
3. 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.

> **Tip:**
More workers answer more visitors at once, but each can use the full **Memory per request**. Keep workers times memory below the memory the server can spare.

## Copies of a website

[Clones and staging copies](https://docs.vaultpanel.net/guides/websites/staging-and-clones) keep the PHP settings of the website they copy. Switching the site's [PHP version](https://docs.vaultpanel.net/guides/websites/php-versions) keeps them too.

## Related

- [PHP versions](https://docs.vaultpanel.net/guides/websites/php-versions) to choose the PHP version a site runs.
- [Caching](https://docs.vaultpanel.net/guides/websites/caching) to answer more visitors without more workers.
- [API reference](https://docs.vaultpanel.net/api-reference/websites#update-a-website) for the `phpSettings` field.
