Skip to content

Commit

Permalink
bug fix: fetch apache php path on al8 and 9
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 30, 2024
1 parent 999531b commit 7d4ca8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
18 changes: 11 additions & 7 deletions plogical/phpUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,19 @@ def GetPHPVersionFromFile(vhFile, domainName=None):
# 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}')
Expand Down
3 changes: 0 additions & 3 deletions plogical/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
strr='8.0.30'

print(strr[:3])

0 comments on commit 7d4ca8b

Please sign in to comment.