Lunarpages Web Hosting Forum

Author Topic: Updating from the PHP 5.6 instance on a Dedicated Server  (Read 1950 times)

Offline AdrianAvadani

  • zombie
  • Administrator
  • Galactic Royalty
  • *****
  • Posts: 237
Updating from the PHP 5.6 instance on a Dedicated Server
« on: January 18, 2019, 01:16:05 AM »

This is a repost for, 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
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, 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 ( and also see 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:

Code: [Select]
/scripts/migrate_ea3_to_ea4 --run
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/
nano /etc/cpanel/ea4/profiles/custom/lp.json

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:
Code: [Select]
   "pkgs" : [
   "version" : "1.0",
   "tags" : [
      "Apache 2.4",
      "PHP 7.2"
   "desc" : "Auto Generated profile",
   "name" : "lp.json"

Code: [Select]
ea_install_profile --install /etc/cpanel/ea4/profiles/custom/lp.jsonand after this completes:
Code: [Select]
/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php72 --ea-php72=suphpor
Code: [Select]
/usr/local/cpanel/bin/rebuild_phpconf --default=ea-php73 --ea-php72=suphp -ea-php73=suphpif you added PHP 7.3 too.
Code: [Select]
/usr/local/cpanel/bin/rebuild_phpconf --current
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 (; it's there where you can get updated methods for PHP upgrades too - such as the one that's currently valid from
Code: [Select]
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
Code: [Select]
rpm -ivh remi-release-7.rpm epel-release-latest-7.noarch.rpm

while CentOS7 customers can simply add the repository via yum:
Code: [Select]
yum install epel-release
Code: [Select]
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

Thank you.
« Last Edit: January 18, 2019, 02:49:53 AM by AdrianAvadani »
Adrian Avadani
System Administrator Team

Telephone: 1-714-521-8150
Fax: 1-714-521-8195