Changing the PHP version in cPanel is essential for maintaining compatibility with your website’s scripts. This tutorial covers three methods to change the PHP version: using the PHP Selector, MultiPHP Manager, and alternative methods such as editing the .htaccess file or contacting support.
Method 1: Using PHP Selector (Recommended)
Step 1: Log in to cPanel
- Access your cPanel account through your hosting provider’s login page.
Step 2: Open PHP Selector
- In the Software section, click on PHP Selector.
Step 3: Select PHP Version
- On the PHP Selector page, you will see a dropdown menu with available PHP versions.
- Select the PHP version you want to use from the dropdown menu.
- Click Set as Current to apply the selected PHP version.
Step 4: Verify the Change
- Check your website to ensure that the new PHP version is working correctly.
- You can also use a PHP info file to verify the current PHP version.
Method 2: Using MultiPHP Manager
Step 1: Log in to cPanel
- Access your cPanel account through your hosting provider’s login page.
Step 2: Open MultiPHP Manager
- In the Software section, click on MultiPHP Manager.
Step 3: Select Domain and PHP Version
- On the MultiPHP Manager page, select the domain for which you want to change the PHP version.
- Choose the desired PHP version from the dropdown menu in the PHP Version column.
- Click Apply to save the changes.
Step 4: Verify the Change
- Ensure that the new PHP version is functioning correctly by checking your website.
- You can use a PHP info file to confirm the current PHP version.
Method 3: Alternative Methods
Using .htaccess File
- If your hosting provider allows it, you can change the PHP version by adding a line to your .htaccess file:
AddHandler application/x-httpd-php81 .php
- Replacephp81 with the desired PHP version.
- Save the file and upload it to your server.
Contacting Support
- If you are unable to change the PHP version through cPanel, contact your hosting provider’s support team for assistance.
By following these methods, you can easily manage and update the PHP version for your website through cPanel.