install lsphp80 if not present for mautic

This commit is contained in:
usman@cyberpersons.com
2023-08-10 14:52:21 +05:00
parent db8903bcf5
commit c5e7008f2f
2 changed files with 26 additions and 4 deletions

View File

@@ -99,6 +99,12 @@ class ApplicationInstaller(multi.Thread):
password = self.extraArgs['password'] password = self.extraArgs['password']
email = self.extraArgs['email'] email = self.extraArgs['email']
## Open Status File
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Setting up paths,0')
statusFile.close()
### lets first find php path ### lets first find php path
@@ -108,13 +114,18 @@ class ApplicationInstaller(multi.Thread):
phpPath = phpUtilities.GetPHPVersionFromFile(vhFile) phpPath = phpUtilities.GetPHPVersionFromFile(vhFile)
### basically for now php 8.0 is being checked
if not os.path.exists(phpPath):
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('PHP 8.0 missing installing now..,20')
statusFile.close()
phpUtilities.InstallSaidPHP('80')
FNULL = open(os.devnull, 'w') FNULL = open(os.devnull, 'w')
## Open Status File
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('Setting up paths,0')
statusFile.close()
finalPath = '' finalPath = ''
self.permPath = '' self.permPath = ''

View File

@@ -232,6 +232,17 @@ class phpUtilities:
result = result.rsplit("lsphp", 1)[0] + "php" result = result.rsplit("lsphp", 1)[0] + "php"
return result return result
@staticmethod
def InstallSaidPHP(php):
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
command = f'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp{php}*'
else:
command = f'dnf install lsphp{php}* --exclude lsphp73-pecl-zip --exclude *imagick* -y --skip-broken'
ProcessUtilities.executioner(command, None, True)