In this article we explain how to easily change the PHP version for your website in just a few clicks in cPanel.
How To Change PHP Version
- Login into cPanel
- Go to Software section
- Click on PHP Version Manager
- Choose the public_html directory (in case you would like to make the change for the whole website)
- Select PHP version from the list
- Click Save
Note. Before making any changes, we strongly recommend to contact with your webmaster, to make sure that all website extensions compatible with new PHP version.
Using multiple PHP versions on one account
When using different software on one account, you may need to use one version of PHP while running a different version of PHP on a different domain. For example: You can have PHP 5.6 for the site in public_html and then use PHP 5.4 in a subdirectory. You can use any combination of other PHP versions in any directory on the account.
Using the Default PHP version
To use the system default PHP, use the following in .htaccess:
# Use system PHP5 as default AddHandler application/x-httpd-php5 .php
This will make the specific directory use the System default PHP version. Depending on what version of PHP you want to use, you will need to placed the following code in the .htaccess of the directory you want to change the PHP version for.