You can easily change the PHP version in cPanel in one of the following ways.
#1. From MultiPHP INI Manager
- Log in to your cPanel account.
- Go inside Software section and click on MultiPHP Manager.On the next page, list of all your domains will appear. Select the one for which you want to change the PHP version.(You may select all)
- Go to PHP Version given on the right side and select version from the drop down button.
- Select the PHP version from the list and click over Apply.
Refer to the blog to learn in detail procedure.
#2. By Editing .htaccess file
- Login to cPanel and get inside File Manager section.
- Get inside the domain directory for which you want to change the PHP version and create a .htaccess file inside it. (If you want to change the PHP version of whole website then create the file inside public_html)
- Right click .htaccess file you will need to and then Edit.
- Paste the below given code.
<FilesMatch "\.(php4|php5|php7|php3|php2|php|phtml)$"> SetHandler application/x-httpd-alt-php56 </FilesMatch>
*(Make sure you replace the php version in the code with the actual PHP version. For ex: if you want to change the version to 7.0 then just remove “php56” and write there “php7.0”]
- Click over Save Changes to save the edited file.
Refer to the blog and video tutorial to learn the detailed procedure to change PHP version.