How to Change PHP Version in cPanel.

How to Change PHP Version in cPanel.

To change the PHP version in cPanel using the MultiPHP Manager option ,we can change the cPanel PHP version.

Step 1. Login to cPanel account.

Step 2. Click the MultiPHP Manager link in the Software section of cPanel.

Step3.Check the box for the site or site(s) you wish to update.

Step 5.Select the desired PHP Version from the drop-down menu.

Step 6. Click the Apply button.

Additionally you can change the cPanel version from the “select php version”

Please note “Select PHP version” option is available only on servers that use Cloudlinux. You may need to confirm with your hosting provider about Cloudlinux. I use RSHosting hosting company to host my websites and you can find the option “Select PHP version” in their cPanel.

Step 1. Login to cPanel account.

Step 2. In cPanel search bar,search the “select php version”

Now navigate to Select PHP Version

Simply click the drop-down option next to PHP Version, choose the version you wish to use, and then click Set as current to make the change.

Now sometimes after changing the php version it doesn’t reflect on the site, the site still runs on the older php version, so in this case you can check your website’s .htaccess file for any code that might specify a PHP version. Sometimes, there could be directives in this file that override the PHP version set in cPanel.

Alternatively, you can create a PHP info file (e.g., info.php) with the following code to your website’s root directory and access it in your web browser.

<?php

phpinfo();

?>

To adding the above code in info.php file you can simply browse your website i.e https://xyz.com/info.php

This will show you in detail.

Changing the PHP version can sometimes affect how your website functions. It’s important to test your website after changing the PHP version to ensure everything works correctly

Check for any errors, missing features, or functionality issues.

If you encounter any problems, try to troubleshoot them by trying other PHP versions available. Most of the times, the errors are due to application and PHP version compatibility. Outdated applications may not work on latest PHP versions, so you may want to update your applications such as WordPress Plugins.

Now from this interface you can also change php values.

Changing PHP Options

To access and customize PHP options, click on ‘Switch to PHP Options.’

Let’s see some common PHP options that you may want to customize for your website:

“Memory Limit: Adjust the amount of memory PHP can use for scripts.”

“Max Execution Time: Set the maximum time a PHP script can run before timing out.”

“Upload Max Filesize: Define the maximum file size for file uploads.”

“Post Max Size: Specify the maximum size for POST requests.

Once you’ve adjusted PHP options to your liking, scroll down to the bottom of the page.”

Click ‘Apply’ or ‘Save’ to save your changes and update your PHP configuration

After making changes to PHP options, it’s crucial to test your website’s functionality.”

Check for any errors, issues, or unexpected behavior that may arise.

Any PHP settings that you enter with new values will then have the modification made to your hosting account.

                           Enabling PHP Extensions

Simply check the box next to the PHP extension you want to enable to make it active.

Note: In order to handle the PHP extensions, you must be using a non-native version of PHP.

Choose which extensions for the current PHP version you wish to enable:

That is all.