mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
feature: add php8
This commit is contained in:
@@ -192,6 +192,15 @@ class InstallCyberPanel:
|
|||||||
if res != 0:
|
if res != 0:
|
||||||
InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1)
|
InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1)
|
||||||
|
|
||||||
|
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \
|
||||||
|
'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \
|
||||||
|
'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \
|
||||||
|
'lsphp8?-sqlite8 lsphp8?-tidy'
|
||||||
|
|
||||||
|
res = os.system(command)
|
||||||
|
if res != 0:
|
||||||
|
InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1)
|
||||||
|
|
||||||
elif self.distro == centos:
|
elif self.distro == centos:
|
||||||
command = 'yum -y groupinstall lsphp-all'
|
command = 'yum -y groupinstall lsphp-all'
|
||||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
@@ -232,8 +241,11 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = 'yum install lsphp80*'
|
||||||
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
if self.distro == cent8:
|
if self.distro == cent8:
|
||||||
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* --exclude lsphp73-pecl-zip -y'
|
command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip -y'
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
def installMySQL(self, mysql):
|
def installMySQL(self, mysql):
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ class PHPManager:
|
|||||||
def findPHPVersions():
|
def findPHPVersions():
|
||||||
distro = ProcessUtilities.decideDistro()
|
distro = ProcessUtilities.decideDistro()
|
||||||
if distro == ProcessUtilities.centos:
|
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']
|
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']
|
||||||
elif distro == ProcessUtilities.cent8:
|
elif distro == ProcessUtilities.cent8:
|
||||||
return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4']
|
return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0']
|
||||||
elif distro == ProcessUtilities.ubuntu20:
|
elif distro == ProcessUtilities.ubuntu20:
|
||||||
return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4']
|
return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0']
|
||||||
else:
|
else:
|
||||||
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4']
|
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0']
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getPHPString(phpVersion):
|
def getPHPString(phpVersion):
|
||||||
@@ -42,6 +42,8 @@ class PHPManager:
|
|||||||
php = "73"
|
php = "73"
|
||||||
elif phpVersion == "PHP 7.4":
|
elif phpVersion == "PHP 7.4":
|
||||||
php = "74"
|
php = "74"
|
||||||
|
elif phpVersion == "PHP 8.0":
|
||||||
|
php = "80"
|
||||||
|
|
||||||
return php
|
return php
|
||||||
|
|
||||||
|
|||||||
@@ -1939,6 +1939,10 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
|||||||
|
|
||||||
Upgrade.executioner(command, 'Install PHP 74, 0')
|
Upgrade.executioner(command, 'Install PHP 74, 0')
|
||||||
|
|
||||||
|
if Upgrade.installedOutput.find('lsphp80') == -1:
|
||||||
|
command = 'yum install lsphp80*'
|
||||||
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \
|
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \
|
||||||
'lsphp7? lsphp7?-common lsphp7?-curl lsphp7?-dev lsphp7?-imap lsphp7?-intl lsphp7?-json ' \
|
'lsphp7? lsphp7?-common lsphp7?-curl lsphp7?-dev lsphp7?-imap lsphp7?-intl lsphp7?-json ' \
|
||||||
@@ -1946,6 +1950,13 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
|||||||
'lsphp7?-sqlite3 lsphp7?-tidy'
|
'lsphp7?-sqlite3 lsphp7?-tidy'
|
||||||
Upgrade.executioner(command, 'Install PHP 73, 0')
|
Upgrade.executioner(command, 'Install PHP 73, 0')
|
||||||
|
|
||||||
|
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \
|
||||||
|
'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \
|
||||||
|
'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \
|
||||||
|
'lsphp8?-sqlite8 lsphp8?-tidy'
|
||||||
|
|
||||||
|
Upgrade.executioner(command, 'Install PHP 80, 0')
|
||||||
|
|
||||||
CentOSPath = '/etc/redhat-release'
|
CentOSPath = '/etc/redhat-release'
|
||||||
|
|
||||||
if not os.path.exists(CentOSPath):
|
if not os.path.exists(CentOSPath):
|
||||||
|
|||||||
Reference in New Issue
Block a user