@@ -58,7 +58,7 @@ def findPHPVersions():
5858 # Method 2: Check system-wide PHP installations
5959 try :
6060 # Check for system PHP versions
61- system_php_versions = ['7.4' , '8.0' , '8.1' , '8.2' , '8.3' , '8.4' , '8.5' ]
61+ system_php_versions = ['7.4' , '8.0' , '8.1' , '8.2' , '8.3' , '8.4' , '8.5' , '8.6' ]
6262 for version in system_php_versions :
6363 formatted_version = f'PHP { version } '
6464 if formatted_version not in finalPHPVersions :
@@ -117,7 +117,7 @@ def findPHPVersions():
117117
118118 # Method 4: Fallback to checking common PHP versions
119119 if not finalPHPVersions :
120- fallback_versions = ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' ]
120+ fallback_versions = ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.6' ]
121121 for version in fallback_versions :
122122 try :
123123 phpString = PHPManager .getPHPString (version )
@@ -145,25 +145,18 @@ def version_sort_key(version):
145145 from plogical .CyberCPLogFileWriter import CyberCPLogFileWriter as logging
146146 logging .writeToFile (f'Final PHP versions found: { finalPHPVersions } ' )
147147
148- return finalPHPVersions if finalPHPVersions else ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' ]
148+ return finalPHPVersions if finalPHPVersions else ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.6' ]
149149
150150 except BaseException as msg :
151151 from plogical .CyberCPLogFileWriter import CyberCPLogFileWriter as logging
152152 logging .writeToFile (f'Error while finding php versions on system: { str (msg )} ' )
153- return ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' ]
153+ return ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.6' ]
154154
155155 @staticmethod
156156 def findApachePHPVersions ():
157- # distro = ProcessUtilities.decideDistro()
158- # if distro == ProcessUtilities.centos:
159- # return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
160- # elif distro == ProcessUtilities.cent8:
161- # return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
162- # elif distro == ProcessUtilities.ubuntu20:
163- # return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1']
164- # else:
165- # return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5']
166-
157+ """
158+ Dynamically detect available Apache PHP versions by scanning the system
159+ """
167160 try :
168161
169162 # Run the shell command and capture the output
@@ -222,7 +215,7 @@ def findApachePHPVersions():
222215 except BaseException as msg :
223216 from plogical .CyberCPLogFileWriter import CyberCPLogFileWriter as logging
224217 logging .writeToFile (f'Error while finding php versions on system: { str (msg )} ' )
225- return ['PHP 7.0' , 'PHP 7.1' , 'PHP 7.2' , 'PHP 7.3' , 'PHP 7. 4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' ]
218+ return ['PHP 7.4' , 'PHP 8.0' , 'PHP 8.1' , 'PHP 8.2' , 'PHP 8.3' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.6 ' ]
226219
227220 @staticmethod
228221 def getPHPString (phpVersion ):
@@ -338,7 +331,7 @@ def getRecommendedPHPVersion():
338331 return 'PHP 8.3' # Default recommendation
339332
340333 # Priority order for recommendations
341- recommended_order = ['PHP 8.3' , 'PHP 8.2' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.1' , 'PHP 8.0' , 'PHP 7.4' ]
334+ recommended_order = ['PHP 8.3' , 'PHP 8.2' , 'PHP 8.4' , 'PHP 8.5' , 'PHP 8.6' , 'PHP 8. 1' , 'PHP 8.0' , 'PHP 7.4' ]
342335
343336 for recommended in recommended_order :
344337 if recommended in all_versions :
0 commit comments