From 6dbcc6ace75e258abda00641d124a34622b3d406 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 25 Dec 2021 12:40:45 +0500 Subject: [PATCH] PHP 8.1: https://github.com/usmannasir/cyberpanel/issues/780 --- install/installCyberPanel.py | 6 ++++++ managePHP/phpManager.py | 8 ++++---- plogical/upgrade.py | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index b17ae843d..f0a5a7f1c 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -200,6 +200,9 @@ class InstallCyberPanel: command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80*' os.system(command) + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp81*' + os.system(command) + elif self.distro == centos: command = 'yum -y groupinstall lsphp-all' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) @@ -241,6 +244,9 @@ class InstallCyberPanel: command = 'yum install lsphp80* -y' subprocess.call(command, shell=True) + command = 'yum install lsphp81* -y' + subprocess.call(command, shell=True) + if self.distro == cent8: command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip -y' subprocess.call(command, shell=True) diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index 07e82635f..f21d9674c 100755 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -14,13 +14,13 @@ class PHPManager: def findPHPVersions(): distro = ProcessUtilities.decideDistro() if distro == ProcessUtilities.centos: - return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] + return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] elif distro == ProcessUtilities.cent8: - return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] + return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] elif distro == ProcessUtilities.ubuntu20: - return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] + return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] else: - return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] + return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] @staticmethod def getPHPString(phpVersion): diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 344e9aaf7..efd10b4b5 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2156,6 +2156,10 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'yum install lsphp80* -y' subprocess.call(command, shell=True) + if Upgrade.installedOutput.find('lsphp80') == -1: + command = 'yum install lsphp81* -y' + subprocess.call(command, shell=True) + except: command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ 'lsphp7? lsphp7?-common lsphp7?-curl lsphp7?-dev lsphp7?-imap lsphp7?-intl lsphp7?-json ' \ @@ -2166,6 +2170,9 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80*' os.system(command) + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp81*' + os.system(command) + CentOSPath = '/etc/redhat-release' if not os.path.exists(CentOSPath):