diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 408f47519..017f86757 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -31,7 +31,7 @@ class ApplicationInstaller(multi.Thread): LOCALHOST = 'localhost' REMOTE = 0 PORT = '3306' - MauticVersion = '4.4.0' + MauticVersion = '4.4.9' PrestaVersion = '1.7.8.3' def __init__(self, installApp, extraArgs): @@ -99,6 +99,15 @@ class ApplicationInstaller(multi.Thread): password = self.extraArgs['password'] email = self.extraArgs['email'] + + ### lets first find php path + + from plogical.phpUtilities import phpUtilities + + vhFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf' + + phpPath = phpUtilities.GetPHPVersionFromFile(vhFile) + FNULL = open(os.devnull, 'w') ## Open Status File @@ -242,7 +251,7 @@ $parameters = array( command = 'cp %s %s/app/config/local.php' % (localDB, finalPath) ProcessUtilities.executioner(command, externalApp) - command = "/usr/local/lsws/lsphp80/bin/php bin/console mautic:install http://%s -f" % (finalURL) + command = f"{phpPath} bin/console mautic:install http://%s -f" % (finalURL) result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath) if result.find('Install complete') == -1: diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index ff567bc56..c663e46e4 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -191,7 +191,6 @@ class phpUtilities: str(msg) + " [savePHPConfigAdvance]") print("0,"+str(msg)) - @staticmethod def GetStagingInJson(stagings): try: @@ -217,6 +216,25 @@ class phpUtilities: except BaseException as msg: return msg + @staticmethod + def GetPHPVersionFromFile(vhFile): + if ProcessUtilities.decideServer() == ProcessUtilities.OLS: + command = f'grep -Eo "/usr/local/lsws/lsphp[0-9]+/bin/lsphp" {vhFile}' + result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + + result = result.rsplit("lsphp", 1)[0] + "php" + return result + + else: + command = f'grep -Eo -m 1 "php[0-9]+" {vhFile}' + result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + result = f'/usr/local/lsws/ls{result}/bin/lsphp' + result = result.rsplit("lsphp", 1)[0] + "php" + return result + + + + def main(): diff --git a/websiteFunctions/templates/websiteFunctions/installMautic.html b/websiteFunctions/templates/websiteFunctions/installMautic.html index dbda62697..b3388b446 100755 --- a/websiteFunctions/templates/websiteFunctions/installMautic.html +++ b/websiteFunctions/templates/websiteFunctions/installMautic.html @@ -21,8 +21,10 @@