diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 017f86757..5a68bfa42 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -99,6 +99,12 @@ class ApplicationInstaller(multi.Thread): password = self.extraArgs['password'] email = self.extraArgs['email'] + ## Open Status File + + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('Setting up paths,0') + statusFile.close() + ### lets first find php path @@ -108,13 +114,18 @@ class ApplicationInstaller(multi.Thread): 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') - ## Open Status File - statusFile = open(tempStatusPath, 'w') - statusFile.writelines('Setting up paths,0') - statusFile.close() finalPath = '' self.permPath = '' diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index c663e46e4..4a0a130d7 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -232,6 +232,17 @@ class phpUtilities: result = result.rsplit("lsphp", 1)[0] + "php" 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) + +