mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
dynamically detect php version in ref to: https://community.cyberpanel.net/t/php-8-2-in-cyberpanel/49703
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user