To change the PHP version in your cPanel account, follow these steps:
-
Log in to your cPanel account. This can usually be done by going to your domain/cpanel in a browser.
-
Once you're logged in, search for the "Software" or "Software/Services" section. The exact name and location may vary depending on your cPanel theme or version.
-
Look for an icon or link labeled "Select PHP Version" or "PHP Configuration." Click on it to proceed.
-
On the PHP Selector page, you should see a list of available PHP versions. Choose the desired PHP version from the list.
-
After selecting the PHP version, click the "Set as Current" or "Apply" button to save the changes.
-
Once the changes are saved, cPanel will generate a new .htaccess file to apply the PHP version settings. This file is automatically updated to reflect the selected PHP version.
-
Optionally, you can verify the PHP version change by visiting your website or running a PHP script. You can create a simple PHP file with the following code:
<?php phpinfo(); ?>
Save the file with a .php extension (e.g., info.php) and upload it to your public_html folder. Access the file through your web browser (e.g., http://yourdomain.com/info.php) ↗) and check the PHP version displayed.
That's it! The PHP version for your cPanel account should now be changed. Remember to remove the info.php file from your hosting account once you've completed the verification.