update php paths

This commit is contained in:
Usman Nasir
2019-12-18 15:34:33 +05:00
parent a25fed80be
commit 5efbb0aaee
4 changed files with 20 additions and 9 deletions

View File

@@ -770,10 +770,12 @@ enabled=1"""
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'yum remove postfix -y' command = 'yum remove postfix -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
else: else:
command = 'apt-get -y remove postfix' command = 'apt-get -y remove postfix'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
self.stdOut("Install dovecot - do the install") self.stdOut("Install dovecot - do the install")

View File

@@ -164,24 +164,25 @@ 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)
else: elif self.distro == cent8:
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)
InstallCyberPanel.stdOut("LiteSpeed PHPs successfully installed!", 1) InstallCyberPanel.stdOut("LiteSpeed PHPs successfully installed!", 1)
## only php 71 ## only php 71
if self.distro == centos or self.distro == cent8: if self.distro == centos or self.distro == cent8:
command = 'yum install lsphp71 lsphp71-json lsphp71-xmlrpc lsphp71-xml lsphp71-tidy lsphp71-soap lsphp71-snmp ' \ command = 'yum install lsphp71 lsphp71-json lsphp71-xmlrpc lsphp71-xml lsphp71-soap lsphp71-snmp ' \
'lsphp71-recode lsphp71-pspell lsphp71-process lsphp71-pgsql lsphp71-pear lsphp71-pdo lsphp71-opcache ' \ 'lsphp71-recode lsphp71-pspell lsphp71-process lsphp71-pgsql lsphp71-pear lsphp71-pdo lsphp71-opcache ' \
'lsphp71-odbc lsphp71-mysqlnd lsphp71-mcrypt lsphp71-mbstring lsphp71-ldap lsphp71-intl lsphp71-imap ' \ 'lsphp71-odbc lsphp71-mysqlnd lsphp71-mcrypt lsphp71-mbstring lsphp71-ldap lsphp71-intl lsphp71-imap ' \
'lsphp71-gmp lsphp71-gd lsphp71-enchant lsphp71-dba lsphp71-common lsphp71-bcmath -y' 'lsphp71-gmp lsphp71-gd lsphp71-enchant lsphp71-dba lsphp71-common lsphp71-bcmath -y'
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)
## only php 72 ## only php 72
command = 'yum install -y lsphp72 lsphp72-json lsphp72-xmlrpc lsphp72-xml lsphp72-tidy lsphp72-soap lsphp72-snmp ' \ command = 'yum install -y lsphp72 lsphp72-json lsphp72-xmlrpc lsphp72-xml lsphp72-soap lsphp72-snmp ' \
'lsphp72-recode lsphp72-pspell lsphp72-process lsphp72-pgsql lsphp72-pear lsphp72-pdo lsphp72-opcache ' \ 'lsphp72-recode lsphp72-pspell lsphp72-process lsphp72-pgsql lsphp72-pear lsphp72-pdo lsphp72-opcache ' \
'lsphp72-odbc lsphp72-mysqlnd lsphp72-mcrypt lsphp72-mbstring lsphp72-ldap lsphp72-intl lsphp72-imap ' \ 'lsphp72-odbc lsphp72-mysqlnd lsphp72-mcrypt lsphp72-mbstring lsphp72-ldap lsphp72-intl lsphp72-imap ' \
'lsphp72-gmp lsphp72-gd lsphp72-enchant lsphp72-dba lsphp72-common lsphp72-bcmath' 'lsphp72-gmp lsphp72-gd lsphp72-enchant lsphp72-dba lsphp72-common lsphp72-bcmath'
@@ -189,7 +190,7 @@ 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)
## only php 72 ## only php 72
command = 'yum install -y lsphp73 lsphp73-json lsphp73-xmlrpc lsphp73-xml lsphp73-tidy lsphp73-soap lsphp73-snmp ' \ command = 'yum install -y lsphp73 lsphp73-json lsphp73-xmlrpc lsphp73-xml lsphp73-soap lsphp73-snmp ' \
'lsphp73-recode lsphp73-pspell lsphp73-process lsphp73-pgsql lsphp73-pear lsphp73-pdo lsphp73-opcache ' \ 'lsphp73-recode lsphp73-pspell lsphp73-process lsphp73-pgsql lsphp73-pear lsphp73-pdo lsphp73-opcache ' \
'lsphp73-odbc lsphp73-mysqlnd lsphp73-mcrypt lsphp73-mbstring lsphp73-ldap lsphp73-intl lsphp73-imap ' \ 'lsphp73-odbc lsphp73-mysqlnd lsphp73-mcrypt lsphp73-mbstring lsphp73-ldap lsphp73-intl lsphp73-imap ' \
'lsphp73-gmp lsphp73-gd lsphp73-enchant lsphp73-dba lsphp73-common lsphp73-bcmath' 'lsphp73-gmp lsphp73-gd lsphp73-enchant lsphp73-dba lsphp73-common lsphp73-bcmath'
@@ -289,8 +290,10 @@ class InstallCyberPanel:
def startMariaDB(self): def startMariaDB(self):
############## Start mariadb ###################### ############## Start mariadb ######################
if self.distro == cent8 or self.distro == ubuntu:
command = "systemctl start mysql" command = 'systemctl start mariadb'
else:
command = "systemctl start mysql"
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)
############## Enable mariadb at system startup ###################### ############## Enable mariadb at system startup ######################

View File

@@ -11,7 +11,10 @@ class PHPManager:
@staticmethod @staticmethod
def findPHPVersions(): def findPHPVersions():
if ProcessUtilities.decideDistro() == ProcessUtilities.centos: distro = ProcessUtilities.decideDistro()
if distro == ProcessUtilities.centos:
if distro == ProcessUtilities.cent8:
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3']
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'] 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']
else: else:
return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3'] return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3']

View File

@@ -13,6 +13,7 @@ class ProcessUtilities(multi.Thread):
ent = 1 ent = 1
OLS = 0 OLS = 0
centos = 1 centos = 1
cent8 = 2
ubuntu = 0 ubuntu = 0
server_address = '/usr/local/lscpd/admin/comm.sock' server_address = '/usr/local/lscpd/admin/comm.sock'
token = "unset" token = "unset"
@@ -137,6 +138,8 @@ class ProcessUtilities(multi.Thread):
if os.path.exists(distroPath): if os.path.exists(distroPath):
return ProcessUtilities.ubuntu return ProcessUtilities.ubuntu
else: else:
if open('/etc/redhat-release', 'r').read().find('CentOS Linux release 8') > -1:
return ProcessUtilities.cent8
return ProcessUtilities.centos return ProcessUtilities.centos
@staticmethod @staticmethod