bug fix: mautic installer on ubuntu 22

This commit is contained in:
usmannasir
2024-10-04 15:49:14 +05:00
parent d1171a6e25
commit 9ad40d5f2f
2 changed files with 45 additions and 35 deletions

View File

@@ -123,7 +123,6 @@ class ApplicationInstaller(multi.Thread):
if result.find('npm <command>') > -1:
return 1
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
nodeV = ProcessUtilities.fetch_latest_lts_version_for_node()
if ACLManager.ISARM():
@@ -157,12 +156,6 @@ class ApplicationInstaller(multi.Thread):
command = f'rm -rf node-{nodeV}-linux-x64*'
ProcessUtilities.executioner(command, 'root', True)
else:
#command = 'curl -fsSL <https://deb.nodesource.com/setup_20.x> | sudo -E bash -'
#ProcessUtilities.executioner(command, 'root', True)
command = 'DEBIAN_FRONTEND=noninteractive apt-get install nodejs npm -y'
ProcessUtilities.executioner(command, 'root', True)
return 1
@@ -198,7 +191,7 @@ class ApplicationInstaller(multi.Thread):
phpPath = phpUtilities.GetPHPVersionFromFile(vhFile, domainName)
### basically for now php 8.0 is being checked
### basically for now php 8.1 is being checked
if not os.path.exists(phpPath):
statusFile = open(tempStatusPath, 'w')
@@ -206,6 +199,18 @@ class ApplicationInstaller(multi.Thread):
statusFile.close()
phpUtilities.InstallSaidPHP('81')
### if web is using apache then some missing extensions are required to install
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
if os.path.exists(finalConfPath):
if ProcessUtilities.decideDistro() == ProcessUtilities.cent8 or ProcessUtilities.decideDistro() == ProcessUtilities.centos:
command = 'dnf install php7.?-bcmath php7.?-imap php8.?-bcmath php8.?-imap -y'
else:
command = 'DEBIAN_FRONTEND=noninteractive apt-get install php7.?-bcmath php7.?-imap php8.?-bcmath php8.?-imap -y'
ProcessUtilities.executioner(command)
FNULL = open(os.devnull, 'w')
@@ -362,10 +367,15 @@ class ApplicationInstaller(multi.Thread):
#os.remove(localDB)
command = f"systemctl restart {ApacheVhost.serviceName}"
ProcessUtilities.normalExecutioner(command)
ProcessUtilities.executioner(command)
installUtilities.reStartLiteSpeedSocket()
time.sleep(3)
command = f"systemctl restart {ApacheVhost.serviceName}"
ProcessUtilities.executioner(command)
statusFile = open(tempStatusPath, 'w')
statusFile.writelines("Successfully Installed. [200]")
statusFile.close()

View File

@@ -21,7 +21,7 @@
</h3>
<div class="example-box-wrapper">
<strong style="margin:2%; color: red">{% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.0, which is supported by Mautic." %}</strong>
<strong style="margin:2%; color: red">{% trans "Before installing Mautic, we will change the PHP version of the website to PHP 8.1, which is supported by Mautic." %}</strong>
<form style="margin-top:1%" name="websiteCreationForm" action="/" id="createPackages" class="form-horizontal bordered-row">