# Changing your PHP version and settings (Select PHP Version)

> Change your PHP version, turn PHP extensions on or off, and raise limits such as memory_limit, upload size and max_execution_time in cPanel.

Source: https://helpcenter.ruachost.com/cpanel/software/changing-php-versions-and-settings-using-php-selector/

Ruachost hosting uses CloudLinux **Select PHP Version** (also called PHP Selector) in cPanel. It's where you change your PHP version, switch extensions on or off, and change PHP settings such as the memory limit or maximum upload size. You don't need to edit `php.ini` or `.htaccess` files.

> **Note:**
The PHP version you choose applies to **your whole hosting account**, including all your addon domains and subdomains. You can't run a different PHP version for one domain or folder.

## Change your PHP version

1. Log in to cPanel and open **Select PHP Version** under **Software**.
2. Next to **PHP version**, open the list and choose a version.
3. The change applies straight away. Reload your website to check it.

You can choose PHP **5.2 to 8.5**. New accounts start on **PHP 8.2**. The version marked **native** is the server's built-in PHP.

**Which version should I use?** Use the newest version your website supports. Newer versions are faster and get security fixes. Today we recommend **PHP 8.2 to 8.4** for WordPress and most modern apps. Versions older than 8.1 no longer get security updates, so only use them for old scripts that can't be upgraded.

Before you upgrade, update your website software, plugins and themes, and [take a backup](https://helpcenter.ruachost.com/cpanel/files/restoring-files-email-and-databases-using-jetbackup/). If something breaks, switch back to the previous version and see [Resolving common PHP upgrade issues](https://helpcenter.ruachost.com/developers/php/resolving-common-php-upgrade-issues/).

## Turn extensions on or off

1. In **Select PHP Version**, open the **Extensions** tab.
2. Tick an extension to turn it on, or untick it to turn it off. Changes save automatically.

More than 100 extensions are available, including `imagick`, `intl`, `redis`, `memcached`, `ioncube_loader`, `sourceguardian`, `opcache`, `soap`, `sodium` and `zip`. Greyed-out extensions are built in and always on.

Each PHP version has its own list of extensions, so check them again after changing version. To undo your changes, click **Reset PHP Extensions to default**.

> **Tip:**
"Call to undefined function" errors usually mean an extension is turned off. For example, `imagecreatetruecolor()` needs `gd`, and `mb_strlen()` needs `mbstring`. See [Common PHP errors](https://helpcenter.ruachost.com/developers/php/common-php-errors/).

## Change PHP settings (Options)

1. In **Select PHP Version**, open the **Options** tab.
2. Click the value next to a setting and choose or type a new one. Changes save automatically.

These are the settings people change most, and their default values on Ruachost:

| Setting | Default | What it does |
| --- | --- | --- |
| `memory_limit` | 512M | The most memory one PHP script can use. Choose up to 2G. See [PHP memory limit vs your plan's RAM](https://helpcenter.ruachost.com/developers/php/resolving-the-allowed-memory-size-exhausted-php-error-message/). |
| `upload_max_filesize` | 512M | The largest file you can upload through your website. |
| `post_max_size` | 512M | The largest form submission, including uploads. Keep it the same as or bigger than `upload_max_filesize`. |
| `max_execution_time` | 60 | How many seconds a script can run before it's stopped. |
| `max_input_time` | 600 | How many seconds PHP spends receiving form data and uploads. |
| `max_input_vars` | 10000 | How many form fields a request can have. Raise it if large menus or settings pages don't save fully. |
| `date.timezone` | UTC | The time zone PHP uses. For Nigeria, use `Africa/Lagos`. |
| `display_errors` | Off | Shows PHP errors on your web pages. Keep it Off on a live site. See [PHP error logs](https://helpcenter.ruachost.com/developers/php/enabling-php-error-logging/). |
| `log_errors` | On | Writes PHP errors to an `error_log` file. |
| `allow_url_fopen` | On | Lets PHP open files from other websites. Some apps need it. |
| `error_reporting` | All except deprecated | Which kinds of errors PHP reports. |
| `disable_functions` | Empty | Functions you want to block on your account. |
| `short_open_tag` | Off | Allows `<?` instead of `<?php`. Only old scripts need it. |
| `zlib.output_compression` | Off | Compresses PHP output. LiteSpeed already compresses pages, so leave it Off. |

To undo a change, set the value back to the default shown above.

> **Uploads still failing after raising the limit?:**
Your website software may have its own limit. In WordPress, check **Media → Add New**, which shows the maximum upload size. Very large files are better uploaded with [FTP](https://helpcenter.ruachost.com/cpanel/files/publishing-your-website-with-ftp-or-a-desktop-editor/) or File Manager.

## Changed the version, but your site still shows the old one?

- **Check `.htaccess` for old PHP handler lines.** Lines like `AddHandler application/x-httpd-ea-php74___lsphp .php` (often left by a previous host or an old cPanel tool) force a fixed PHP version and override Select PHP Version. In File Manager, open `.htaccess` in your site's folder (turn on **Show Hidden Files**), and remove or comment out any `AddHandler` or `SetHandler` line that mentions PHP. Take a copy of the file first.
- **Clear your caches.** Purge LiteSpeed Cache or your site's caching plugin, and your browser cache.
- **Check the version your site really uses** with [phpinfo()](https://helpcenter.ruachost.com/developers/php/viewing-php-settings-with-the-phpinfo-function/).

## Using php.ini, .user.ini or .htaccess instead

Select PHP Version is the easiest and most reliable way to change PHP settings, and its settings apply to your whole account. If one folder needs different settings, see [Custom PHP settings per folder with .user.ini](https://helpcenter.ruachost.com/developers/php/custom-php-settings-per-directory-with-user-ini-files/).

## Related articles

- [PHP versions and default limits](https://helpcenter.ruachost.com/developers/php/php-versions-and-default-limits/)
- [Common PHP errors and how to fix them](https://helpcenter.ruachost.com/developers/php/common-php-errors/)
- [Finding PHP error logs and showing or hiding errors](https://helpcenter.ruachost.com/developers/php/enabling-php-error-logging/)
- [Updating the PHP version for WordPress](https://helpcenter.ruachost.com/wordpress/guides/updating-php-version-for-wordpress-using-cpanel/)
