Skip to content

Commit

Permalink
pssobile bug in wp installer
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Nov 28, 2023
1 parent 36c0d62 commit c8da443
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
9 changes: 8 additions & 1 deletion plogical/applicationInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,17 @@ def installWordPress(self):

### lets first find php path


from plogical.phpUtilities import phpUtilities

vhFile = f'/usr/local/lsws/conf/vhosts/{domainName}/vhost.conf'

phpPath = phpUtilities.GetPHPVersionFromFile(vhFile)
try:

phpPath = phpUtilities.GetPHPVersionFromFile(vhFile)
except:
phpPath = '/usr/local/lsws/lsphp80/bin/php'


### basically for now php 8.0 is being checked

Expand All @@ -632,6 +638,7 @@ def installWordPress(self):
statusFile.close()
phpUtilities.InstallSaidPHP('80')


finalPath = ''
self.permPath = ''

Expand Down
2 changes: 2 additions & 0 deletions plogical/phpUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def GetPHPVersionFromFile(vhFile, domainName=None):
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}')

if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
command = f'grep -Eo "/usr/local/lsws/lsphp[0-9]+/bin/lsphp" {vhFile}'
Expand Down
13 changes: 0 additions & 13 deletions plogical/test.py
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
import subprocess

# Run the shell command and capture the output
result = subprocess.run(['ls', '-la'], capture_output=True, text=True)

# Get the lines containing 'lsphp' in the output
lsphp_lines = [line for line in result.stdout.split('\n') if 'lsphp' in line]

# Extract the version from the lines
php_versions = [line.split()[8] for line in lsphp_lines]

print(php_versions)

0 comments on commit c8da443

Please sign in to comment.