From 7d4ca8bf0b8c191792e4ffa197b31fa120dc012e Mon Sep 17 00:00:00 2001 From: usmannasir Date: Mon, 30 Sep 2024 12:40:19 +0500 Subject: [PATCH] bug fix: fetch apache php path on al8 and 9 --- plogical/phpUtilities.py | 18 +++++++++++------- plogical/test.py | 3 --- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 3fe78a571..4328c5e55 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -241,15 +241,19 @@ class phpUtilities: # Input string #php_version = "php73" - # Insert a period between '7' and '3' to convert it to 'php7.3' - converted_version = php_version[:4] + '.' + php_version[4:] + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + command = f'/opt/remi/{php_version}/root/bin/php' + return command + else: + # Insert a period between '7' and '3' to convert it to 'php7.3' + converted_version = php_version[:4] + '.' + php_version[4:] - # Output the result - print(converted_version) + # Output the result + print(converted_version) - result = f'/usr/bin/{converted_version}' - #result = result.rsplit("lsphp", 1)[0] + "php" - return result + result = f'/usr/bin/{converted_version}' + #result = result.rsplit("lsphp", 1)[0] + "php" + return result if os.path.exists('/usr/local/CyberCP/debug'): logging.CyberCPLogFileWriter.writeToFile(f'VHFile in GetPHPVersion {vhFile}') diff --git a/plogical/test.py b/plogical/test.py index d88b0177f..e69de29bb 100644 --- a/plogical/test.py +++ b/plogical/test.py @@ -1,3 +0,0 @@ -strr='8.0.30' - -print(strr[:3]) \ No newline at end of file