Choose the PHP Version in cPanel using PHP Selector
By default all of our shared hosting servers run PHP 5.6 as the native PHP version. This version is the lowest common version to be most compatible with applications. If you wish to use a newer or older version of PHP (5.2, 5.3, 5.4, 5.5 and 7.0 at the time of writing), you may choose to in your own cPanel account.
As part of the CloudLinux operating system, we are running a tool called "PHP Selector", which allows users to select the PHP version they would like to run on their hosting account. This allows users with applications that require a newer version of PHP to be able to switch to their desired version of PHP from within their cPanel interface.
How to switch between PHP versions
Log into your cPanel and follow the steps below:
1. Under the "Software/Services" tab, click on the "Select PHP Version" icon.
2. From the drop down box, select the PHP version you would like to run on your account, then click on the "Set as Current" button. If you want to switch back to the default PHP version running on the server at any time, you can select "Native" from the drop down box.
3. After selecting your PHP version, you will see a list of the different PHP modules you can run. Unless you know the specific modules your application needs to run, click on "Use Defaults". This uses the same modules that are running in the servers default PHP configuration and is recommended.
After making your module selections, click on the "Save" button. Your settings are applied instantly and ready for you to test in your application.
5. To change individual settings within a PHP version you are using, click on Switch to PHP Settings.
By clicking on one of the options (in grey), you will be presented with a drop-down list to change specific settings. Select "Apply" to implement the settings:
OK you're done! After clicking on the "Save" button your account will be running your chosen PHP version.
Can I run two different applications on two different versions of PHP?
PHP Selector sets the PHP version on a per cPanel account basis. So if you have two or more different applications running on a single cPanel account with one requiring a specific version of PHP and the other script requiring another version, you would need to use two different cPanel accounts.
Please sign in to leave a comment.