# How to manage the PHP version in cPanel using the Select PHP Version tool

> Switch PHP versions, enable extensions, and configure PHP options in cPanel with the Select PHP Version tool.

Source: https://www.kualo.com/knowledgebase/cpanel-php/how-to-manage-the-php-version-in-cpanel-using-the-select-php-version-tool
Updated: 2026-06-11

---

The **Select PHP Version** tool (also called the **PHP Selector**) lets you choose your own PHP version, enable or disable extensions, and adjust PHP settings - all independently of other users on the server.

:::danger
Changing the PHP version here applies to **your entire hosting account**. If you need different PHP versions for different folders, subdomains, or addon domains, see our guide on [Setting PHP versions per folder or website using .htaccess](/knowledgebase/cpanel-how-tos/setting-php-versions-per-folder-website-using-htaccess-addhandler).
:::

## Switching your PHP version

1. Log in to cPanel.
2. Under the **Software** section, click **Select PHP Version**.
3. The tool opens on the **Account Global Settings** tab. Next to **PHP version**, open the drop-down and choose the version you want. To set a version for one specific domain instead, use the **Per Domain Settings** tab.

   ![Choosing your PHP version in the Select PHP Version tool](https://kb-cdn.kualo.com/2c/65/2c657f68020e22edf6ff39577acb8b5dc6edf394.png)

4. The change applies straight away and your sites start using the selected version. Review your extensions and options (see the sections below) so the new version has everything your sites need.

:::warning
**Enable OpCache for best performance.** We strongly recommend keeping the **OpCache** extension enabled. If it is unchecked, your site may run noticeably slower.
:::

## Managing PHP extensions

On the **Extensions** tab, tick or untick a module to enable or disable it. Changes take effect immediately - there is no Save button. Greyed-out, already-ticked extensions are built in and cannot be turned off, and **Reset PHP Extensions to default** restores the defaults for the selected version.

![The PHP extensions list in the Select PHP Version tool](https://kb-cdn.kualo.com/35/c8/35c8ffec1c349d54a171b5a13deb7c4e0d0970af.png)

## Modifying PHP options

Click the **Options** tab (next to Extensions) to adjust individual PHP configuration settings such as `allow_url_fopen`, `max_execution_time`, `memory_limit`, `upload_max_filesize`, and more.

![The PHP Options tab in the Select PHP Version tool](https://kb-cdn.kualo.com/19/b8/19b879b9681ad3342cca80b7007a14f1661a97ba.png)

Changes here are saved as you make them. If you are unsure about a setting, use the reset option to return it to the recommended default.

## PHP options explained

The sections below describe the most commonly used PHP options and our recommendations for each.

### Performance and stability

- **`max_execution_time`** - Controls how long a script can run before it times out. A typical value is **30** or **60** seconds, but long-running tasks such as imports or backups may need a higher value.
- **`memory_limit`** - Defines how much memory a single PHP process can use. Do not set this too high. If your plan has 1 GB of RAM, setting this to `1G` means one PHP process could consume all available memory. Keep it as low as your application needs - typically **128M** to **256M**.
- **`realpath_cache_ttl`** - Controls how long realpath cache entries are stored. A value of **7200** (two hours) can improve performance on sites with many file operations.
- **`realpath_cache_size`** - Defines the size of the realpath cache. **4096K** is generally recommended for optimal performance.

:::info
**PHP memory for CLI and cron jobs**

The `memory_limit` setting applies to web-based PHP requests. For command-line scripts and cron jobs, you can use a higher limit without raising the global web limit. Pass the `-d` flag in your command instead:

```bash
php -d memory_limit=512M /path/to/script.php
```
:::

### Security settings

- **`allow_url_fopen`** - Allows PHP to fetch external URLs via `file_get_contents()` and similar functions. Enable only if your application requires it, as it carries a security risk.
- **`expose_php`** - Controls whether PHP advertises its version in HTTP response headers. Set this to **Off** to avoid giving attackers information about your PHP version.
- **`open_basedir`** - Restricts PHP scripts to specific directories, preventing access to files outside the web root.
- **`session.save_path`** - Defines where PHP stores session files. Leave this as the default (`/opt/alt/phpXX/var/lib/php/session`) unless you have a specific reason to change it.

### File uploads and limits

- **`file_uploads`** - Controls whether PHP allows file uploads. Set to **On** if your site accepts user-uploaded files.
- **`upload_max_filesize`** - Sets the maximum size for a single uploaded file. Increase this if users have trouble uploading large files (for example, **128M**).
- **`post_max_size`** - Defines the maximum size of all POST data, including file uploads. This must be equal to or larger than `upload_max_filesize`.
- **`upload_tmp_dir`** - Temporary directory used during file uploads. Leave as the default unless you have a specific requirement.

### Error handling and debugging

- **`display_errors`** - Controls whether PHP errors are shown in the browser. Set to **Off** on live sites for security; enable only when debugging.
- **`log_errors`** - Logs PHP errors to a file. By default, errors are written to an `error_log` file in the root folder of your application (for example, `public_html` for your main site, or the root folder of an addon domain or subdomain).
- **`error_reporting`** - Controls which errors are logged. A common setting is `E_ALL & ~E_NOTICE & ~E_DEPRECATED`, which captures critical issues while suppressing minor notices.

### Legacy code compatibility

- **`short_open_tag`** - Allows `<?` as a shorthand for `<?php`. Keep this **Off** unless a legacy script specifically requires it.
- **`include_path`** - Defines the search paths for included files. Leave as the default unless your application requires otherwise.

## Important things to keep in mind

- **Settings apply account-wide.** The PHP version and options set here affect your entire hosting account unless overridden via `.htaccess`.
- **`.htaccess` can override cPanel settings.** If your PHP version does not appear to change, check whether an `.htaccess` file is enforcing a different version.
- **Check compatibility.** Before switching PHP versions, confirm that your scripts, themes, and plugins support the version you are selecting.
- **OpCache improves performance.** Always verify that OpCache is enabled after making changes.

:::info
**Need different PHP versions for different folders or websites?** See our guide on [Setting PHP versions per folder or website using .htaccess](/knowledgebase/cpanel-how-tos/setting-php-versions-per-folder-website-using-htaccess-addhandler).
:::

If you need a hand, our support team is available 24/7 - just [open a support ticket](/knowledgebase/getting-started/how-to-create-a-support-ticket-in-mykualo).


---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/cpanel-php/how-to-manage-the-php-version-in-cpanel-using-the-select-php-version-tool · © Kualo Ltd._
