# PHP Extensions and Settings

Source: https://support.kapsulehost.com/en-nz/php-extensions-and-ini

Which PHP versions and extensions KapsuleHost web hosting provides for WordPress, WooCommerce and PHP sites, which settings you can change yourself, and why a change can take up to five minutes to appear.

Static, Node.js and Python sites do not run PHP. Everything to do with PHP for a site lives in one place: **Websites**, click the site, **Settings**, then **PHP**. That page holds the version selector, the settings you can change, a Composer runner, and the PHP error log.

![The PHP page for a site in KPanel, with the version selector and the settings you can change](https://support.kapsulehost.com/help/screenshots/php-extensions-and-ini.2214ab47.webp)

## Choosing a PHP Version

Four versions are selectable: **8.4, 8.3, 8.2 and 8.1**. New sites default to 8.3.

Pick the newest version your software actually supports. Newer PHP is meaningfully faster and is supported with security fixes for longer. The reason not to jump straight to the newest is compatibility: an old plugin or a piece of custom code written years ago can fail outright on a version it has never been tested against.

To change it, select the version and click **Apply Version**. The change takes effect immediately, with no restart needed on your part and no downtime.

> **Tip:** Change PHP version on staging first, click through the site, and only then change it on production. If you must do it live, do it when you can watch, and know that switching back is one click. See [Staging Environments](https://support.kapsulehost.com/en-nz/staging-environments).

If a version change breaks the site, switch back to the previous version and read the log. The error will name the file that could not run. See [Changing PHP Version](https://support.kapsulehost.com/en-nz/changing-php-version) and [Error Logs](https://support.kapsulehost.com/en-nz/error-logs).

## Settings You Can Change

The PHP page exposes five settings as dropdowns. These are the ones that actually cause problems in practice, which is why they are the ones surfaced.

| Setting | Default | Available values | What it controls |
|---|---|---|---|
| `memory_limit` | 256M | 128M, 256M, 512M, 1024M, 2048M | How much memory one request may use |
| `max_execution_time` | 30 | 30, 60, 120, 300, 600 | How many seconds one request may run |
| `upload_max_filesize` | 64M | 16M, 32M, 64M, 128M, 256M | The largest single file that can be uploaded |
| `post_max_size` | 65M | 17M, 33M, 65M, 129M, 257M | The largest total form submission |
| `max_input_vars` | 3000 | 1000, 3000, 5000, 10000 | How many fields one submission may contain |

Which one you want:

- **Uploads failing above a certain size**: raise `upload_max_filesize`, and `post_max_size` with it.
- **A large form or a page builder losing fields on save**: raise `max_input_vars`. This one is invisible and infuriating, because nothing errors. The extra fields are silently discarded.
- **A page dying part way through with no error**: raise `memory_limit`. See [WordPress Memory Limit](https://support.kapsulehost.com/en-nz/wordpress-memory-limit).
- **A long import or export timing out**: raise `max_execution_time`, and consider running the job from the command line instead. See [WP-CLI](https://support.kapsulehost.com/en-nz/wordpress-wp-cli).

> **Note:** `post_max_size` must be larger than `upload_max_filesize`, because the upload travels inside the post. If you pick a combination where it is not, the platform corrects `post_max_size` up for you. That is why you may see a value you did not choose.

## Why a Change Takes up to Five Minutes

This is the single most common confusion on this page, so it is worth being precise.

Your settings are written to a `.user.ini` file in your site's document root. PHP reads that file and then **caches it for 300 seconds**, which is five minutes. Until that cache expires, PHP keeps using the previous values.

So after saving a change:

- The page will still report the old limit for up to five minutes.
- `phpinfo()` will still report the old limit for up to five minutes.
- A hard refresh does not help. Neither does clearing your browser cache.
- You do not need to restart anything, and you cannot. Just wait.

If it has been more than five minutes and the value has not changed, then something is genuinely wrong and it is worth a ticket.

## Editing `.user.ini` Yourself

You can edit `.user.ini` directly over SFTP or SSH if you prefer, or if you need a directive the panel does not expose. It lives in your site's document root. See [SFTP Access](https://support.kapsulehost.com/en-nz/sftp-access).

Format is one directive per line:

```ini
memory_limit = 512M
max_execution_time = 120
```

Two important limits on what `.user.ini` can do:

**It only works for directives PHP allows to be set per directory or per user.** The five above all qualify. Directives that can only be set at the system level, such as `disable_functions` or loading an extension with `extension=`, are ignored in a `.user.ini` file. They will not error, they will simply do nothing, which is why people spend an afternoon on them.

**The panel only reads back simple keys.** Directives containing a dot, such as `opcache.enable` or `date.timezone`, are honoured by PHP but will not appear in the panel form. If you set one by hand and later change something through the panel, check the file afterwards.

> **Warning:** KapsuleHost web hosting runs nginx, not Apache. `.htaccess` files are read by nobody. PHP directives placed in a `.htaccess` file, such as `php_value memory_limit`, do absolutely nothing here. Use `.user.ini` or the panel instead. See [WordPress and .htaccess](https://support.kapsulehost.com/en-nz/wordpress-htaccess).

## Which Extensions Are Available

The standard build is broad and includes everything WordPress, WooCommerce and most PHP applications ask for.

**Databases**: `mysqli`, `pdo_mysql`, `sqlite3`, `pdo_sqlite`
**Images**: `gd`, `imagick`, `exif`
**Caching**: `Zend OPcache`, `redis`, `memcached`
**Text and locale**: `mbstring`, `iconv`, `intl`, `gettext`, `ctype`
**XML and data**: `dom`, `simplexml`, `xml`, `xmlreader`, `xmlwriter`, `xsl`, `json`
**Network**: `curl`, `soap`, `sockets`, `ftp`, `openssl`
**Maths and crypto**: `bcmath`, `sodium`, `hash`, `random`
**Files and system**: `fileinfo`, `zip`, `zlib`, `phar`, `posix`, `pcntl`, `shmop`, `calendar`, `tokenizer`

One version difference worth knowing: the `imap` extension is present on 8.3 and earlier but not on 8.4, because it was removed from PHP itself in that release. If you have an application that still needs it, stay on 8.3 or move that application to a modern mail library.

**Not installed**: PostgreSQL drivers, MongoDB, Xdebug, `mcrypt`, and commercial code loaders such as ionCube and SourceGuardian.

You cannot enable or disable extensions yourself from the panel. If your application needs something that is not in the list, open a ticket and describe what you are running. Whether it can be added depends on the extension. See [Opening a Support Ticket](https://support.kapsulehost.com/en-nz/opening-a-support-ticket).

## Checking What Is Actually Loaded

Rather than guessing:

- **On WordPress**: Tools, then Site Health, then Info, then Server. It lists the PHP version and the relevant limits.
- **Over SSH**: `php -v` for the version and `php -m` for the loaded extensions. See [Adding SSH Keys](https://support.kapsulehost.com/en-nz/adding-ssh-keys).

> **Warning:** Do not leave a `phpinfo()` file in your web root. It publishes your paths, your extensions and your configuration to anyone who finds it, and automated scanners look for exactly that filename. If you create one to check something, delete it immediately afterwards.

## Related Guides

- [Changing PHP Version](https://support.kapsulehost.com/en-nz/changing-php-version)
- [WordPress Memory Limit](https://support.kapsulehost.com/en-nz/wordpress-memory-limit)
- [Error Logs](https://support.kapsulehost.com/en-nz/error-logs)
- [HTTP Error Codes](https://support.kapsulehost.com/en-nz/http-error-codes)
- [Site Slowness and Resource Limits](https://support.kapsulehost.com/en-nz/site-slow-resource-limits)
- [WordPress and .htaccess](https://support.kapsulehost.com/en-nz/wordpress-htaccess)
- [Hosting Glossary](https://support.kapsulehost.com/en-nz/glossary)
