mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 15:56:11 +01:00
feature: support upto php 8.4 on apache manager
This commit is contained in:
@@ -99,6 +99,11 @@ class ApacheVhost:
|
||||
finalConfPath = ApacheVhost.php83Path + virtualHostName
|
||||
elif php == '84':
|
||||
finalConfPath = ApacheVhost.php84Path + virtualHostName
|
||||
elif php == '85':
|
||||
finalConfPath = ApacheVhost.php85Path + virtualHostName
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile(f'Decided path in DecidePHPPath {finalConfPath}.conf')
|
||||
|
||||
return finalConfPath + '.conf'
|
||||
|
||||
@@ -535,6 +540,39 @@ class ApacheVhost:
|
||||
command = f"systemctl restart {phpService}"
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
phpPath = ApacheVhost.DecidePHPPath('83', virtualHostName)
|
||||
if os.path.exists(phpPath):
|
||||
os.remove(phpPath)
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
phpService = f'php83-php-fpm'
|
||||
else:
|
||||
phpService = f"php8.3-fpm"
|
||||
|
||||
command = f"systemctl restart {phpService}"
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
phpPath = ApacheVhost.DecidePHPPath('84', virtualHostName)
|
||||
if os.path.exists(phpPath):
|
||||
os.remove(phpPath)
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
phpService = f'php84-php-fpm'
|
||||
else:
|
||||
phpService = f"php8.4-fpm"
|
||||
|
||||
command = f"systemctl restart {phpService}"
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
phpPath = ApacheVhost.DecidePHPPath('85', virtualHostName)
|
||||
if os.path.exists(phpPath):
|
||||
os.remove(phpPath)
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
phpService = f'php85-php-fpm'
|
||||
else:
|
||||
phpService = f"php8.5-fpm"
|
||||
|
||||
command = f"systemctl restart {phpService}"
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
@staticmethod
|
||||
def changePHP(phpVersion, vhFile):
|
||||
try:
|
||||
@@ -564,6 +602,9 @@ class ApacheVhost:
|
||||
child = ChildDomains.objects.get(domain=virtualHostName)
|
||||
externalApp = child.master.externalApp
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile(f"PHP version before getPHPString: {phpVersion}")
|
||||
|
||||
php = PHPManager.getPHPString(phpVersion)
|
||||
|
||||
finalConfPath = ApacheVhost.DecidePHPPath(php, virtualHostName)
|
||||
|
||||
@@ -633,7 +633,7 @@ class vhost:
|
||||
|
||||
from plogical.phpUtilities import phpUtilities
|
||||
|
||||
phpVersion = phpUtilities.FindIfSaidPHPIsAvaiableOtherwiseMaketheNextOneAvailableToUse(vhFile, phpVersion)
|
||||
phpVersion = phpUtilities.FindIfSaidPHPIsAvaiableOtherwiseMaketheNextOneAvailableToUse(None, phpVersion)
|
||||
|
||||
phpDetachUpdatePath = '/home/%s/.lsphp_restart.txt' % (vhFile.split('/')[-2])
|
||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||
|
||||
Reference in New Issue
Block a user