BuycPanel Blog

BuycPanel Blog

Latest news and updates

8/11/2015 – Change the Version of PHP on your Server

Posted by Jamison on 11 08 2015.

Before you change the PHP version on your server, first determine the default version of PHP on your server.  It is displayed on the cPanel interface.

 

You can find out your default PHP version by doing the following steps:

 

STEP 1: Log in to your cPanel.

STEP 2: The left side of the screen will line up “Notices” “Find” and “Stats” boxes, and below the Stats box is the “expand stats” link.  Click on the link.

STEP 3: The stats box will expand into different server details such as main domain, home directory address, disk space usage, monthly bandwidth transfer, hosting package, server name, cPanel and Apache version.  Below Apache version is “PHP Version.”  This will state the default version of PHP of your account.

 

Below is another way to determine the default PHP version of your account:

 

STEP 1: Log in to your cPanel.

STEP 2: Navigate to the 1H Software section of your cPanel dashboard…

Before you change the PHP version on your server, first determine the default version of PHP on your server.  It is displayed on the cPanel interface.

 

You can find out your default PHP version by doing the following steps:

 

STEP 1: Log in to your cPanel.

STEP 2: The left side of the screen will line up “Notices” “Find” and “Stats” boxes, and below the Stats box is the “expand stats” link.  Click on the link.

STEP 3: The stats box will expand into different server details such as main domain, home directory address, disk space usage, monthly bandwidth transfer, hosting package, server name, cPanel and Apache version.  Below Apache version is “PHP Version.”  This will state the default version of PHP of your account.

 

Below is another way to determine the default PHP version of your account:

 

STEP 1: Log in to your cPanel.

STEP 2: Navigate to the 1H Software section of your cPanel dashboard and select the “PHP Configuration” icon.  This function allows you to switch PHP versions for each of your accounts.

STEP 3: Select “public_html”

STEP 4: A listing of PHP versions will be displayed and one version will be labeled “System Default” beside it.

 

Below are the steps to change your PHP version:

 

STEP 1: Log in to your cPanel.

STEP 2: Navigate to the 1H Software section of your cPanel dashboard and select the “PHP Version Manager” icon.

STEP 3: Click on the folder icons of the directories you wish to change the PHP version.

 

Note that by selecting the folder, change of PHP version will likewise apply to its sub-directories.  You can therefore select any sub-directory to change the PHP version.  If you apply changes in a sub-directory, it will not affect the root directory.  Hence, it is feasible to have different PHP versions simultaneously running on the within the same account.

 

STEP 4: If you want to apply changing of PHP version to the whole account, go to “public_html” directory.

STEP 5: You can apply change to your existing “.htaccess” file or create a new one to switch to your desired version.

STEP 6: Choose the PHP version from the list of available versions you want to apply.  Note that changes will be applied to the respective sub-directories.

STEP 6: Click Save.

 

You can check if the change is successful by viewing the settings in your PHPinfo page.  You can apply several version changes and it will not adversely impact the functionality of your system.  However, please note that major updates may require adjustments to your configuration.

 

Please note that unless you install a customization such as CloudLinux PHP Selector, you can only install one version of PHP 5 which is the major version of PHP supported by cPanel and WHM.  CloudLinux provides a PHP Selector feature where you can easily choose your desired PHP version.  For more information regarding this, you may refer to CloudLinux website.