How to change the PHP version in cpanel?

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.

  • How to select a different PHP version on each folder, how to change the php version of any folder in cpanel, How to set a php version through .htaccess in cPanel, How to Set the PHP Version per Folder, How to Set Custom PHP Version per Directory, How to set the PHP version for any folder via htaccess in cPanel, cpanel, how to change php version, php version, change php version in cPanel, howto, change php version
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install WordPress in Sub-Directory?

Login to cPanel. Select Softaculous Apps Installer from Software section. Select WordPress...

How to Restore Backups Using JetBackup 4 in cPanel?

Login to cPanel and get inside JetBackups section. Here, you will find multiple features which...

How to Suspend Outgoing Emails of a cPanel Account as WHM Reseller?

To manage the bulk mailing that occurred from a cPanel account hosted within your WHM Reseller,...

How Can You Create/Install WordPress On Sub-Domains?

#1. Create a subdomain of your main domain Log into your cPanel and go to the Subdomains...

How to disallow a particular directory from being crawled by Google?

Login to your cPanel Go inside File Manager Click on public_html Create a robots.txt file....