How to change PHP version in cPanel
It is always important to use the stable, secure, and latest version of PHP. So, in this short tutorial, we are going to see how to change PHP version in cPanel for any kind of website. Besides security, it is important for the website’s performance speed as well.
What is cPanel?
In simple words, cPanel is a web based control panel software provided by your Web Hosting provider which provides a graphical interface to manage different tasks for managing your hosting or website. You can manage website files, email accounts, databases, FTP access and further available features.
You can read more about cPanel here.
Step 1: let’s log in to cPanel using yourwebsite.com/cpanel
or yourwebsite.com:2083
or any login URL provided by your hosting provider.
Step 2: After login, look for the option “Select PHP Version”
under the group titled as “Software”.
If you don’t see such an option, your website is probably using a different version of cPanel. In that case, skip to step 7.
To this date, January 2023, the latest stable PHP version is 8.1
Step 3: Now, you will find “Current PHP Version” under the heading “PHP Extensions”. From this page, you can enable or disable PHP extensions as well, but we are going to change PHP version only for now.
BTW, a PHP extension is a prebuilt library or plug-in that provides extra functions. Web applications use such extensions to perform the complex and repetitive tasks quicker.
Step 4: Click on the current PHP version and select the latest PHP version or 7.4+ version to start.
Warning: PHP versions PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, and PHP 7.4 are deprecated. cPanel strongly recommends that you update to a supported version of PHP. For more information, read cPanel’s PHP documentation.
Step 5: Now, click “Apply” and cPanel will change the PHP version for your website.
Step 6: Now, it is extremely important to check and confirm if your website is working fine. In case, if the website has crashed or not showing anything, that means your website is still using deprecated functions or obsolete code which is no longer supported in the newer version of PHP. Quickly revert to the older but still secured version and definitely fix the obsolete code first by troubleshooting.
In case of older version of cPanel
Follow these steps only in case your cPanel doesn’t show the options or pages mentioned above.
Step 7: After login, look for the option called “MultiPHP Manager”
under the group titled as “Software”.<
Step 8: You will see all of your domains added here. Select the one you want to change the PHP version for.
Step 9: Select the latest or recommended PHP version from the dropdown list and click Apply. And it's done!
Finally, after changing the PHP version, please follow the same step 6 to check if your website is working fine after the version upgrade. That's it for now.
Furthermore, in case you have any questions, feel free to let me know in the comments below and don't forget to check further PHP and cPanel tutorials.