This is a repost for https://www.lunarpages.com/forums/index.php?topic=101716.msg434300#msg434300
, as the procedure is fairly similar on VPS and DedicatedServers, giving that we've completely phased out Virtuozzo now.
As some of you know, PHP 5.6, which appears to be one of the most commonly used versions of the popular interpreter, is now End of Life, which means it will no longer be supported and a security concern going forward. Because of this, the recommendation is to consider switching as soon as possible to a supported version (you can see the valid releases at any point at https://secure.php.net/supported-versions.php
The following wiki assumes you have previously logged in via SSH to manage your VPS/Dedicated machine - if you have not, I strongly suggest considering one of our Managed Hosting plans plan (details at https://lunarpages.com/web-hosting/addons/managed-hosting-services/
), where we will handle updates such as this one for you. Ensure that all the applications you host are fully compatible with the release you're planning to add, since reverting back will be almost impossible due to multiple dependencies that will need to be fixed - most of the recent applications support both PHP 7.2 and PHP 7.3; if you're on something that is a couple of years old, you've got even more security concerns and we'd strongly advise switching to applications that are actively maintained and fully updated.
You will need root permissions to perform the update, which will go through as follows, irrespective of whether you're on a VPS or a Dedicated server at this point:
1) For CPanel servers, you will need to switch to EasyApache 4 (https://documentation.cpanel.net/display/EA4/How+to+Install+or+Uninstall+EasyApache+4
and also see https://www.lunarpages.com/forums/index.php?topic=101695.0
.) if you haven't done it by now; if you are already on EasyApache4, you can scroll for the upgrade procedures. For safety, you can save the output of "php -m", just in case you need additional PHP modules. You can either update EasyApache from WHM -> EasyApache, or from SSH as follows:
yum -y erase ea-apache24-mod_ruid2
yum -y install ea-apache24-mod_lsapi liblsapi liblsapi-devel ea-apache24-mod_suexec ea-apache24-mod_suphp
mkdir -p /etc/cpanel/ea4/profiles/custom/
and then create the JSON file with the versions you need; you can specify multiple packages (i.e. both PHP 7.2 and PHP 7.3) in here, then you'll be able to assign these on a per-domain basis from CPanel's MultiPHP Manager:
"pkgs" : [
"version" : "1.0",
"tags" : [
"desc" : "Auto Generated profile",
"name" : "lp.json"
ea_install_profile --install /etc/cpanel/ea4/profiles/custom/lp.json
and after this completes:
/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php72 --ea-php72=suphp
/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php73 --ea-php72=suphp -ea-php73=suphp
if you added PHP 7.3 too.
should output the selected version(s).
That is it! What's even greater is that, from now on, CPanel will automatically update Apache and PHP for you (within the installed release trees, however) via its cron, which runs daily.
2) For Plesk servers, you will first need to ensure you're running an updated version. Details on how to do this can be found through their support pages (https://support.plesk.com/hc/en-us/articles/213408749-How-to-upgrade-Plesk-to-the-next-release-);
it's there where you can get updated methods for PHP upgrades too - such as the one that's currently valid from https://support.plesk.com/hc/en-us/articles/115000769793-How-to-install-remove-additional-PHP-versions-provided-by-Plesk
plesk installer --select-release-current --show-components
plesk installer --select-release-current --install-component php7.2
plesk installer --select-release-current --remove-component php5.6
service httpd restart
3) For LPCP servers, you will need to install the remi and epel repositories. CentOS6 (running "cat /etc/redhat-release" will show your actual OS version) customers will need to do
rpm -ivh remi-release-7.rpm epel-release-latest-7.noarch.rpm
while CentOS7 customers can simply add the repository via yum:
yum install epel-release
yum install yum-utils
yum-config-manager --enable remi-php72
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo php-mbstring php-xml php-xmlrpc php-zip
service httpd restart
(you can follow the same format to install additional PHP extensions)
You can then load a phpinfo(); page to confirm that the update went through as expected and that your domain name uses the updated release.
Please let us know if you have any questions, concerns or suggestions. If you do get stuck, you can contact our team at any point at email@example.com.