In some cases, the correct functioning of your website depends on a PHP version installed on the server.
This guide describes how to change php version on Shared servers (Stellar, Stellar Plus plans and old Value, Professional, Ultimate plans). For Business SSD servers, use this guide.
Thanks to the PHP Selector function, it is possible to select the necessary PHP version as well as enable/disable certain PHP modules and functions.
3. Here you will see the list of available modules and extensions.
If you do not need to change the PHP version and just want to turn on/off specific extensions, you can do this by checking/unchecking the corresponding boxes.
Use the PHP Version drop-down box to select the required version, click on Set as current in order to apply the changes.
NOTE: The ‘native’ PHP version does not allow changing any options. You can set the desired values using a php.ini file:
By clicking on one of the options in grey, you will be presented with a drop-down list to change specific settings. Hit Apply to implement the settings:
NOTE 1: It is recommended to update your website scripts and use PHP 5.6. If the latest software you run for your websites is not yet compiled for PHP 5.6, please contact the script vendor for a compatibility patch.
NOTE 2: If you used a php.ini file for editing your account PHP configuration before, you will need to replicate the custom values using PHP Selector tool.
NOTE 3: In order to increase the max upload size, make sure to modify both post_max_size and upload_max_filesize values.
To set a different PHP version for an addon domain, you need to add a special code to your .htaccess file. To do this, follow the steps below.
1. Find the .htaccess file for the addon domain in question. The steps for how to find it can be located here.
2. Add the following line to your .htaccess file:
<FilesMatch ".(?:html|php)$"> SetHandler application/x-lsphpXX </FilesMatch>
where XX is the PHP version you wish to set. It can be 52, 53, 54, 55, 56, 70, 71,72, or 73.
You can download the php.ini file for different PHP versions from the Attachments section at the end of this guide. Do not forget to rename the file to php.ini once it is uploaded to the hosting account.
Alternatively, you can run the command below via SSH:
cp /opt/alt/default_php_ini/phpXX.ini /home/cPanel_username/path_to_the_folder/php.ini
The process is similar if you wish to set a different PHP version for a subdomain.
When setting up different FTP, mail, MySQL programs, etc., you need to specify the server hostname. You can check what server your account is hosted on in different ways.
1. Log into cPanel by typing into a browser http://yourdomain.tld/cpanel:
In this example, the hostname is server126.web-hosting.com
2. You can look up the hostname in Hosting Welcome Guide >> Hosting package details section:
NOTE: Alternatively, to set up an application, you can use your account IP address as a hostname.