# Change your PHP version and settings
Source: https://docs.webgee.com/en/development/change-php-version







Change the PHP version your site runs on, and adjust settings such as
`memory_limit` or `upload_max_filesize`. Applies to shared, reseller and Premium
hosting.

How you do this depends on whether your site uses **Bolt-Cache**. Bolt-Cache is
an NGINX and PHP-FPM stack available on Premium plans, and it bypasses the cPanel
PHP Selector entirely. If you are not sure which applies, check **cPanel →
Bolt-Cache** — if it is not there, or shows as disabled, use the first method.

## Shared and reseller hosting [#shared-and-reseller-hosting]

Use the PHP Selector, part of CloudLinux. You never need to edit `php.ini`,
`.user.ini` or `.htaccess` by hand.

<img alt="The PHP Selector, showing the version and the Extensions and Options tabs" src="__img0" />

The page opens on **Account Global Settings**, which apply to **every domain on
the account**. To change one domain only, use the **Per Domain Settings** tab —
otherwise you will move all of them at once.

### Change the version [#change-the-version]

1. In cPanel, open **Select PHP Version**.

2. Choose the version you want from the **PHP version** list.

   <img alt="The PHP version list" src="__img1" />

3. Select **Apply**.

The change takes effect immediately.

<Callout type="info">
  The list goes back a long way — 5.2 onwards. Anything below 8.1 is past end of
  life and receives no security fixes. Pick the newest version your application
  supports, not the oldest one that works.
</Callout>

<Callout type="warn">
  Moving between major versions — 7.4 to 8.x especially — can break older themes
  and plugins. Take a snapshot first: see
  [Take a snapshot backup](/en/backups/jetbackup-snapshot-backups).
</Callout>

### Change settings such as memory\_limit [#change-settings-such-as-memory_limit]

1. In cPanel, open **Select PHP Version**.
2. Select the **Options** tab, beneath the version selector.
3. Find the setting you want and change its value.

Changes save as you make them. The values most people come here for are
`memory_limit`, `upload_max_filesize`, `post_max_size` and `max_execution_time`.

### Enable or disable extensions [#enable-or-disable-extensions]

On the same page, select the **Extensions** tab and tick the ones you need.
**Reset PHP Extensions to default** undoes the lot if you lose track of what you
changed. This is where
you turn on `redis` for object caching — see
[Enable Redis object caching](/en/performance/redis-object-caching-lscache).

## Premium hosting with Bolt-Cache [#premium-hosting-with-bolt-cache]

Bolt-Cache replaces Apache with NGINX and PHP-FPM. The PHP Selector no longer
applies, and any changes made there are ignored.

### Change the version [#change-the-version-1]

The PHP version is set when you enable Bolt-Cache. To change it, reconfigure
Bolt-Cache from its cPanel interface and select the version you want there.

### Change settings such as memory\_limit [#change-settings-such-as-memory_limit-1]

Create a file named `.user.ini` in your document root:

```
/home/yourusername/public_html/.user.ini
```

The leading dot is part of the filename and is required. Add one setting per
line, in the same format as `php.ini`:

```ini
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 64M
```

Save the file. The change applies immediately.

## Check it worked [#check-it-worked]

Create a file called `phpinfo.php` in your document root:

```php
<?php phpinfo();
```

Visit `https://example.com/phpinfo.php` and check the version at the top and your
changed value in the table below it.

<Callout type="warn">
  Delete `phpinfo.php` as soon as you have checked. It exposes a great deal of
  detail about your server to anyone who visits it.
</Callout>

## If your setting is ignored [#if-your-setting-is-ignored]

* **On Bolt-Cache, changes made in the PHP Selector do nothing.** Use
  `.user.ini` instead.
* **On shared hosting, a `.user.ini` file does nothing.** Use the PHP Selector.
* **The value is above the plan's ceiling.** Some settings are capped; see
  [Understanding PHP memory limits](/en/development/understanding-php-memory-limits-in-shared-hosting-environments).

## Related [#related]

* [MultiPHP vs Select PHP Version](/en/development/what-is-the-difference-between-the-multiphp-and-select-php-version)
* [Set the date.timezone value](/en/development/setting-date-timezone-value-through-php-selector-in-cpanel)
* [Why PHP-FPM is not enabled on WebGee accounts](/en/development/php-handlers-why-php-fpm-is-not-enabled-on-webgee-accounts)
