From 1dcaea4131fdbab098af284abcc52331673fd6df Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 9 Oct 2025 22:08:54 +0200 Subject: [PATCH 1/7] Enhance OS detection and support for AlmaLinux 10 and additional Ubuntu versions - Added detection for AlmaLinux 10 and updated package manager settings accordingly. - Included support for Ubuntu versions 25.10, 25.04, and 22.04.5 in the OS detection logic. - Updated error messages and supported OS lists to reflect the new additions. - Improved compatibility checks and installation scripts for comprehensive support across the newly added OS versions. --- CPScripts/mailscannerinstaller.sh | 4 +- CPScripts/mailscanneruninstaller.sh | 4 +- INSTALLER_SUMMARY.md | 5 +- README.md | 2 +- cyberpanel.sh | 27 ++++++- cyberpanel_clean.sh | 27 ++++++- cyberpanel_complete.sh | 27 ++++++- cyberpanel_simple.sh | 27 ++++++- cyberpanel_standalone.sh | 27 ++++++- install/install.py | 107 ++++++++++++++++++++++++++-- install/install_utils.py | 4 +- install/universal_os_fixes.py | 2 +- modules/os/detect.sh | 26 +++++-- simple_install.sh | 24 ++++++- 14 files changed, 285 insertions(+), 28 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 76a20e02d..3dea79612 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -55,13 +55,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then Server_OS="CloudLinux" elif grep -q -E "Rocky Linux" /etc/os-release ; then Server_OS="RockyLinux" -elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then +elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 22.04.5|Ubuntu 24.04.3|Ubuntu 25.04|Ubuntu 25.10" /etc/os-release ; then Server_OS="Ubuntu" elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then Server_OS="openEuler" else echo -e "Unable to detect your system..." - echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 22.04.5, Ubuntu 24.04.3, Ubuntu 25.04, Ubuntu 25.10, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" exit fi diff --git a/CPScripts/mailscanneruninstaller.sh b/CPScripts/mailscanneruninstaller.sh index 9eebad670..aa70fb74e 100644 --- a/CPScripts/mailscanneruninstaller.sh +++ b/CPScripts/mailscanneruninstaller.sh @@ -12,13 +12,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then Server_OS="CloudLinux" elif grep -q -E "Rocky Linux" /etc/os-release ; then Server_OS="RockyLinux" -elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then +elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 22.04.5|Ubuntu 24.04.3|Ubuntu 25.04|Ubuntu 25.10" /etc/os-release ; then Server_OS="Ubuntu" elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then Server_OS="openEuler" else echo -e "Unable to detect your system..." - echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 22.04.5, Ubuntu 24.04.3, Ubuntu 25.04, Ubuntu 25.10, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" exit fi diff --git a/INSTALLER_SUMMARY.md b/INSTALLER_SUMMARY.md index 458f6e0a3..12681d126 100644 --- a/INSTALLER_SUMMARY.md +++ b/INSTALLER_SUMMARY.md @@ -92,10 +92,11 @@ bash <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/c ## 🔧 **Fixed Issues:** -### **✅ AlmaLinux 9 Support** +### **✅ AlmaLinux 9/10 Support** - Fixed `aspell` and `libc-client` dependency issues -- Proper package handling for AlmaLinux 9 +- Proper package handling for AlmaLinux 9/10 - Smart fallback for missing packages +- Comprehensive AlmaLinux 10 compatibility fixes ### **✅ Modular Architecture** - Each module under 500 lines (as requested) diff --git a/README.md b/README.md index 11a6adece..6184064fb 100755 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Fast • Secure • Scalable — Simplify hosting management with style. | OS family | Recommended / Supported | | -------------------------- | ----------------------: | -| Ubuntu 24.04, 22.04, 20.04 | ✅ Recommended | +| Ubuntu 25.10, 25.04, 24.04.3, 24.04, 22.04.5, 22.04, 20.04 | ✅ Recommended | | Debian 13, 12, 11 | ✅ Supported | | AlmaLinux 10, 9, 8 | ✅ Supported | | RockyLinux 9, 8 | ✅ Supported | diff --git a/cyberpanel.sh b/cyberpanel.sh index be7af7c01..d578f9149 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -86,6 +86,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" + elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + SERVER_OS="AlmaLinux10" + OS_FAMILY="rhel" + PACKAGE_MANAGER="dnf" + print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -111,6 +116,26 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.10" + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.04" + elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + SERVER_OS="Ubuntu24043" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 24.04.3" + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -133,7 +158,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" return 1 fi diff --git a/cyberpanel_clean.sh b/cyberpanel_clean.sh index 34edb731a..e87ed602b 100644 --- a/cyberpanel_clean.sh +++ b/cyberpanel_clean.sh @@ -78,6 +78,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" + elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + SERVER_OS="AlmaLinux10" + OS_FAMILY="rhel" + PACKAGE_MANAGER="dnf" + print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -103,6 +108,26 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.10" + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.04" + elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + SERVER_OS="Ubuntu24043" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 24.04.3" + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -125,7 +150,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" return 1 fi diff --git a/cyberpanel_complete.sh b/cyberpanel_complete.sh index 6d276d9c3..ce149dffa 100644 --- a/cyberpanel_complete.sh +++ b/cyberpanel_complete.sh @@ -90,6 +90,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "$GREEN" "Detected: AlmaLinux 9" + elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + SERVER_OS="AlmaLinux10" + OS_FAMILY="rhel" + PACKAGE_MANAGER="dnf" + print_status "$GREEN" "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -115,6 +120,26 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "$GREEN" "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 25.10" + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 25.04" + elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + SERVER_OS="Ubuntu24043" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 24.04.3" + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -137,7 +162,7 @@ detect_os() { print_status "$GREEN" "Detected: Debian GNU/Linux 11" else print_status "$RED" "❌ Unsupported OS detected" - print_status "$YELLOW" "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "$YELLOW" "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" return 1 fi diff --git a/cyberpanel_simple.sh b/cyberpanel_simple.sh index 5f469dbf8..ea86d3827 100644 --- a/cyberpanel_simple.sh +++ b/cyberpanel_simple.sh @@ -76,6 +76,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" + elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + SERVER_OS="AlmaLinux10" + OS_FAMILY="rhel" + PACKAGE_MANAGER="dnf" + print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -101,6 +106,26 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.10" + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 25.04" + elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + SERVER_OS="Ubuntu24043" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 24.04.3" + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -123,7 +148,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" return 1 fi diff --git a/cyberpanel_standalone.sh b/cyberpanel_standalone.sh index 5951af816..3083cdea2 100644 --- a/cyberpanel_standalone.sh +++ b/cyberpanel_standalone.sh @@ -89,6 +89,11 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "$GREEN" "Detected: AlmaLinux 9" + elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + SERVER_OS="AlmaLinux10" + OS_FAMILY="rhel" + PACKAGE_MANAGER="dnf" + print_status "$GREEN" "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -114,6 +119,26 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "$GREEN" "Detected: Rocky Linux 8" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 25.10" + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 25.04" + elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + SERVER_OS="Ubuntu24043" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 24.04.3" + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -136,7 +161,7 @@ detect_os() { print_status "$GREEN" "Detected: Debian GNU/Linux 11" else print_status "$RED" "❌ Unsupported OS detected" - print_status "$YELLOW" "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" + print_status "$YELLOW" "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" return 1 fi diff --git a/install/install.py b/install/install.py index 52d4c17b6..d213afa30 100644 --- a/install/install.py +++ b/install/install.py @@ -169,6 +169,11 @@ class preFlightsChecks: os_info = self.detect_os_info() return os_info['name'] == 'almalinux' and os_info['major_version'] == 9 + def is_almalinux10(self): + """Check if running on AlmaLinux 10""" + os_info = self.detect_os_info() + return os_info['name'] == 'almalinux' and os_info['major_version'] == 10 + def is_ubuntu(self): """Check if running on Ubuntu""" os_info = self.detect_os_info() @@ -192,7 +197,7 @@ class preFlightsChecks: if os_info['name'] == 'almalinux' and os_info['major_version'] == 9: fixes.extend(['mariadb', 'services', 'litespeed', 'mysql_gpg']) elif os_info['name'] == 'almalinux' and os_info['major_version'] == 10: - fixes.extend(['mariadb', 'services', 'litespeed']) + fixes.extend(['mariadb', 'services', 'litespeed', 'mysql_gpg']) elif os_info['name'] == 'rocky' and os_info['major_version'] >= 8: fixes.extend(['mariadb', 'services']) elif os_info['name'] == 'rhel' and os_info['major_version'] >= 8: @@ -316,10 +321,10 @@ class preFlightsChecks: if not installed: self.stdOut(f"Package {package} not available, trying alternatives...", 1) - # For AlmaLinux 9, try enabling PowerTools repository first - if self.distro == openeuler and os_info['name'] == 'almalinux' and os_info['major_version'] == '9': + # For AlmaLinux 9/10, try enabling PowerTools repository first + if self.distro == openeuler and os_info['name'] == 'almalinux' and os_info['major_version'] in ['9', '10']: try: - self.stdOut("Enabling AlmaLinux 9 PowerTools repository...", 1) + self.stdOut("Enabling AlmaLinux 9/10 PowerTools repository...", 1) self.call("dnf config-manager --set-enabled powertools", self.distro, "Enable PowerTools", "Enable PowerTools", 1, 0, os.EX_OSERR) # Try installing again with PowerTools enabled command = f"dnf install -y {package} {dev_package}" @@ -746,6 +751,92 @@ class preFlightsChecks: self.stdOut(f"Error in fix_debian_specific: {str(e)}", 0) return False + def fix_almalinux10_comprehensive(self): + """Apply comprehensive AlmaLinux 10 fixes""" + if not self.is_almalinux10(): + return + + self.stdOut("Applying comprehensive AlmaLinux 10 fixes...", 1) + + try: + # Update system packages + self.stdOut("Updating system packages...", 1) + command = "dnf update -y" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Install essential build tools and dependencies + self.stdOut("Installing essential build tools...", 1) + command = "dnf groupinstall -y 'Development Tools'" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + command = "dnf install -y epel-release" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Install AlmaLinux 10 compatibility packages (same as AlmaLinux 9) + self.stdOut("Installing AlmaLinux 10 compatibility packages...", 1) + compat_packages = [ + "libxcrypt-compat", + "libnsl", + "compat-openssl11", + "compat-openssl11-devel" + ] + + for package in compat_packages: + command = f"dnf install -y {package}" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Install PHP dependencies that are missing (with AlmaLinux 10 compatibility) + self.stdOut("Installing PHP dependencies...", 1) + + # Base packages that should work on all systems + base_deps = [ + "ImageMagick", "ImageMagick-devel", + "gd", "gd-devel", + "libicu", "libicu-devel", + "oniguruma", "oniguruma-devel", + "aspell", "aspell-devel", + "freetype-devel", + "libjpeg-turbo-devel", + "libpng-devel", + "libwebp-devel", + "libXpm-devel", + "libzip-devel", + "libxml2-devel", + "openssl-devel", + "curl-devel", + "libxslt-devel", + "sqlite-devel", + "readline-devel", + "libedit-devel", + "pcre2-devel", + "re2c", + "libargon2-devel", + "libsodium-devel" + ] + + for package in base_deps: + command = f"dnf install -y {package}" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Install MariaDB development packages + self.stdOut("Installing MariaDB development packages...", 1) + mariadb_deps = [ + "mariadb-devel", + "mariadb-connector-c-devel" + ] + + for package in mariadb_deps: + command = f"dnf install -y {package}" + self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + self.stdOut("✅ AlmaLinux 10 fixes applied successfully", 1) + + except Exception as e: + self.stdOut(f"❌ Error applying AlmaLinux 10 fixes: {e}", 1) + return False + + return True + def apply_os_specific_fixes(self): """Apply OS-specific fixes based on detected OS""" try: @@ -1895,7 +1986,7 @@ class preFlightsChecks: # Use compatible repository version for RHEL-based systems # AlmaLinux 9 is compatible with el8 repositories os_info = self.detect_os_info() - if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9']: + if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9', '10']: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' else: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' @@ -4441,7 +4532,7 @@ milter_default_action = accept # Use compatible repository version for RHEL-based systems # AlmaLinux 9 is compatible with el8 repositories os_info = self.detect_os_info() - if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9']: + if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9', '10']: repo_command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' else: repo_command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' @@ -5498,9 +5589,11 @@ def main(): # Note: OS-specific fixes are now applied earlier in the installation process # The installCyberPanel.Main() functionality has been integrated into the main installation flow - # Apply AlmaLinux 9 comprehensive fixes first if needed + # Apply AlmaLinux 9/10 comprehensive fixes first if needed if checks.is_almalinux9(): checks.fix_almalinux9_comprehensive() + elif checks.is_almalinux10(): + checks.fix_almalinux10_comprehensive() # Install core services in the correct order checks.installLiteSpeed(ent, serial) diff --git a/install/install_utils.py b/install/install_utils.py index 07982c0c0..546ee5085 100644 --- a/install/install_utils.py +++ b/install/install_utils.py @@ -34,6 +34,8 @@ def FetchCloudLinuxAlmaVersionVersion(): return 'al-87' elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('9.4') > -1 or data.find('9.3') > -1 or data.find('Shamrock Pampas') > -1 or data.find('Seafoam Ocelot') > -1 or data.find('VERSION="9.') > -1): return 'al-93' + elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('10.0') > -1 or data.find('Purple Lion') > -1 or data.find('VERSION="10.') > -1): + return 'al-10' elif data.find('CentOS Stream 9') > -1: return 'el-9' elif data.find('CentOS Linux 9') > -1: @@ -42,8 +44,6 @@ def FetchCloudLinuxAlmaVersionVersion(): return 'el-9' elif data.find('Red Hat Enterprise Linux 9') > -1: return 'el-9' - elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('10.0') > -1 or data.find('Purple Lion') > -1 or data.find('VERSION="10.') > -1): - return 'al-100' else: return -1 diff --git a/install/universal_os_fixes.py b/install/universal_os_fixes.py index eea45dc19..979eb1373 100644 --- a/install/universal_os_fixes.py +++ b/install/universal_os_fixes.py @@ -21,7 +21,7 @@ class UniversalOSFixes: # Supported OS matrix self.supported_os = { - 'ubuntu': ['24.04', '22.04', '20.04'], + 'ubuntu': ['25.10', '25.04', '24.04.3', '24.04', '22.04.5', '22.04', '20.04'], 'debian': ['13', '12', '11'], 'almalinux': ['10', '9', '8'], 'rocky': ['9', '8'], diff --git a/modules/os/detect.sh b/modules/os/detect.sh index 0d0d3550c..63b1db9c7 100644 --- a/modules/os/detect.sh +++ b/modules/os/detect.sh @@ -206,11 +206,17 @@ detect_ubuntu() { PACKAGE_MANAGER="apt" print_status "$GREEN" "Detected: Ubuntu 22.04" return 0 - elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then - SERVER_OS="Ubuntu2404" + elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + SERVER_OS="Ubuntu2510" OS_FAMILY="debian" PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 24.04" + print_status "$GREEN" "Detected: Ubuntu 25.10" + return 0 + elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + SERVER_OS="Ubuntu2504" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 25.04" return 0 elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then SERVER_OS="Ubuntu24043" @@ -218,6 +224,18 @@ detect_ubuntu() { PACKAGE_MANAGER="apt" print_status "$GREEN" "Detected: Ubuntu 24.04.3" return 0 + elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + SERVER_OS="Ubuntu22045" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 22.04.5" + return 0 + elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then + SERVER_OS="Ubuntu2404" + OS_FAMILY="debian" + PACKAGE_MANAGER="apt" + print_status "$GREEN" "Detected: Ubuntu 24.04" + return 0 fi return 1 } @@ -311,7 +329,7 @@ detect_os() { else print_status "$RED" "❌ Unable to detect your OS..." print_status "$YELLOW" "Supported operating systems:" - echo -e "• Ubuntu: 18.04, 20.04, 20.10, 22.04, 24.04, 24.04.3" + echo -e "• Ubuntu: 18.04, 20.04, 20.10, 22.04, 22.04.5, 24.04, 24.04.3, 25.04, 25.10" echo -e "• Debian: 11, 12, 13" echo -e "• AlmaLinux: 8, 9, 10" echo -e "• RockyLinux: 8, 9" diff --git a/simple_install.sh b/simple_install.sh index 3d3cdb5b8..e65c49d33 100644 --- a/simple_install.sh +++ b/simple_install.sh @@ -10,10 +10,30 @@ if echo $OUTPUT | grep -q "AlmaLinux 9" ; then echo -e "\nDetecting AlmaLinux 9...\n" SERVER_OS="AlmaLinux9" PKG_MGR="dnf" +elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then + echo -e "\nDetecting AlmaLinux 10...\n" + SERVER_OS="AlmaLinux10" + PKG_MGR="dnf" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then echo -e "\nDetecting AlmaLinux 8...\n" SERVER_OS="AlmaLinux8" PKG_MGR="yum" +elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then + echo -e "\nDetecting Ubuntu 25.10...\n" + SERVER_OS="Ubuntu2510" + PKG_MGR="apt" +elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then + echo -e "\nDetecting Ubuntu 25.04...\n" + SERVER_OS="Ubuntu2504" + PKG_MGR="apt" +elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then + echo -e "\nDetecting Ubuntu 24.04.3...\n" + SERVER_OS="Ubuntu24043" + PKG_MGR="apt" +elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then + echo -e "\nDetecting Ubuntu 22.04.5...\n" + SERVER_OS="Ubuntu22045" + PKG_MGR="apt" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then echo -e "\nDetecting Ubuntu 22.04...\n" SERVER_OS="Ubuntu2204" @@ -28,8 +48,8 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then PKG_MGR="yum" else echo -e "\nUnsupported OS detected. This script supports:\n" - echo -e "AlmaLinux: 8, 9\n" - echo -e "Ubuntu: 20.04, 22.04\n" + echo -e "AlmaLinux: 8, 9, 10\n" + echo -e "Ubuntu: 20.04, 22.04, 22.04.5, 24.04.3, 25.04, 25.10\n" echo -e "CentOS: 8\n" exit 1 fi From 5c720464e9db860a334cb897af4fe291a74caeb9 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 9 Oct 2025 22:44:31 +0200 Subject: [PATCH 2/7] Add local installation support for CyberPanel - Introduced a new function to install CyberPanel from a local repository if installation files are available. - Updated the installation flow to prioritize local installation before falling back to the direct download method. - Enhanced error handling to provide clearer feedback if local installation files are not found. - Adjusted the installer script to include branch specification for better version control during installation. --- cyberpanel.sh | 70 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index d578f9149..94e41268c 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -597,6 +597,31 @@ cleanup_existing_cyberpanel() { echo " ✅ Cleanup completed" } +# Function to install CyberPanel from local repository +install_cyberpanel_local() { + echo " 🔄 Using local CyberPanel repository..." + + # Check if we're running from a cloned repository + if [ -d "install" ] && [ -f "install/install.py" ]; then + echo " ✓ Found local installation files" + echo " 🔄 Starting CyberPanel installation from local repository..." + echo "" + + # Run the Python installer directly + if [ "$DEBUG_MODE" = true ]; then + python3 install/install.py --debug + else + python3 install/install.py + fi + + return $? + else + echo " ⚠️ Local installation files not found" + echo " 🔄 Falling back to download method..." + install_cyberpanel_direct + fi +} + # Function to install CyberPanel directly using the working method install_cyberpanel_direct() { echo " 🔄 Downloading CyberPanel installation files..." @@ -635,16 +660,16 @@ install_cyberpanel_direct() { cd "$temp_dir" || return 1 # Download the working CyberPanel installation files - echo "Downloading from: https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" + echo "Downloading from: https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" # Try development branch first, fallback to stable local installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" - # Test if the development branch exists - if ! curl -s --head "$installer_url" | grep -q "200 OK"; then + # Test if the development branch exists by trying to download a small file + if curl -s -f -o /dev/null "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/README.md"; then + echo " Using development branch (v2.5.5-dev)" + else echo " Development branch not available, falling back to stable" installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" - else - echo " Using development branch (v2.5.5-dev)" fi curl --silent -o cyberpanel_installer.sh "$installer_url" 2>/dev/null @@ -722,9 +747,9 @@ install_cyberpanel_direct() { # Run installer and show live output, capturing the password if [ "$DEBUG_MODE" = true ]; then - ./cyberpanel_installer.sh --debug 2>&1 | tee /var/log/CyberPanel/install_output.log + ./cyberpanel_installer.sh --debug --branch "$BRANCH_NAME" 2>&1 | tee /var/log/CyberPanel/install_output.log else - ./cyberpanel_installer.sh 2>&1 | tee /var/log/CyberPanel/install_output.log + ./cyberpanel_installer.sh --branch "$BRANCH_NAME" 2>&1 | tee /var/log/CyberPanel/install_output.log fi local install_exit_code=${PIPESTATUS[0]} @@ -2030,10 +2055,17 @@ start_reinstall() { # Install CyberPanel echo "Step 5/6: Installing CyberPanel..." - if ! install_cyberpanel; then + # Try local installation first if available + if [ -d "install" ] && [ -f "install/install.py" ]; then + install_cyberpanel_local + else + install_cyberpanel_direct + fi + + if [ $? -ne 0 ]; then print_status "ERROR: CyberPanel installation failed" - exit 1 -fi + exit 1 + fi echo "" # Apply fixes @@ -2071,7 +2103,14 @@ start_installation() { # Install CyberPanel echo "Step 3/6: Installing CyberPanel..." - if ! install_cyberpanel; then + # Try local installation first if available + if [ -d "install" ] && [ -f "install/install.py" ]; then + install_cyberpanel_local + else + install_cyberpanel_direct + fi + + if [ $? -ne 0 ]; then print_status "ERROR: CyberPanel installation failed" echo "" echo "Would you like to see troubleshooting help? (y/n) [y]: " @@ -2290,7 +2329,14 @@ main() { install_dependencies # Install CyberPanel - if ! install_cyberpanel; then + # Try local installation first if available + if [ -d "install" ] && [ -f "install/install.py" ]; then + install_cyberpanel_local + else + install_cyberpanel_direct + fi + + if [ $? -ne 0 ]; then print_status "ERROR: CyberPanel installation failed" echo "" echo "Would you like to see troubleshooting help? (y/n) [y]: " From 99f651e02fa7e21b9b24019c294013d7c2335fa9 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 9 Oct 2025 23:00:45 +0200 Subject: [PATCH 3/7] Update CyberPanel installation script to prioritize stable branch - Changed the default installer URL to the stable branch, with an option to use the development branch if BRANCH_NAME is set to v2.5.5-dev. - Enhanced the logic to check for the availability of the development branch before falling back to stable. - Updated the archive URL selection based on the chosen branch to ensure correct installation files are downloaded. - Improved feedback messages to clarify which branch is being used during installation. --- cyberpanel.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 94e41268c..c1f54bb18 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -660,16 +660,21 @@ install_cyberpanel_direct() { cd "$temp_dir" || return 1 # Download the working CyberPanel installation files - echo "Downloading from: https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" - # Try development branch first, fallback to stable - local installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" + echo "Downloading from: https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" + # Default to stable branch, but use development if BRANCH_NAME is set + local installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" - # Test if the development branch exists by trying to download a small file - if curl -s -f -o /dev/null "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/README.md"; then - echo " Using development branch (v2.5.5-dev)" + # If BRANCH_NAME is set to v2.5.5-dev, try to use it + if [ "$BRANCH_NAME" = "v2.5.5-dev" ]; then + echo " Attempting to use development branch (v2.5.5-dev)..." + if curl -s -f -o /dev/null "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/README.md"; then + echo " Using development branch (v2.5.5-dev)" + installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" + else + echo " Development branch not available, falling back to stable" + fi else - echo " Development branch not available, falling back to stable" - installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" + echo " Using stable branch" fi curl --silent -o cyberpanel_installer.sh "$installer_url" 2>/dev/null @@ -682,9 +687,9 @@ install_cyberpanel_direct() { # Download the install directory echo "Downloading installation files..." - local archive_url="https://github.com/usmannasir/cyberpanel/archive/v2.5.5-dev.tar.gz" - if [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" ]; then - archive_url="https://github.com/usmannasir/cyberpanel/archive/stable.tar.gz" + local archive_url="https://github.com/usmannasir/cyberpanel/archive/stable.tar.gz" + if [ "$BRANCH_NAME" = "v2.5.5-dev" ] && [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" ]; then + archive_url="https://github.com/usmannasir/cyberpanel/archive/v2.5.5-dev.tar.gz" fi curl --silent -L -o install_files.tar.gz "$archive_url" 2>/dev/null @@ -701,12 +706,12 @@ install_cyberpanel_direct() { fi # Copy install directory to current location - if [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" ]; then - cp -r cyberpanel-stable/install . 2>/dev/null || true - cp -r cyberpanel-stable/install.sh . 2>/dev/null || true - else + if [ "$BRANCH_NAME" = "v2.5.5-dev" ] && [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" ]; then cp -r cyberpanel-v2.5.5-dev/install . 2>/dev/null || true cp -r cyberpanel-v2.5.5-dev/install.sh . 2>/dev/null || true + else + cp -r cyberpanel-stable/install . 2>/dev/null || true + cp -r cyberpanel-stable/install.sh . 2>/dev/null || true fi echo " ✓ CyberPanel installation files downloaded" From 525f8b308cb9af553b8a9c9f90b6a51a1b4d1539 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 9 Oct 2025 23:05:16 +0200 Subject: [PATCH 4/7] =?UTF-8?q?Revert=20"Enhance=20OS=20detection=20and=20?= =?UTF-8?q?support=20for=20AlmaLinux=2010=20and=20additional=20Ubun?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPScripts/mailscannerinstaller.sh | 4 +- CPScripts/mailscanneruninstaller.sh | 4 +- INSTALLER_SUMMARY.md | 5 +- README.md | 2 +- cyberpanel.sh | 27 +------ cyberpanel_clean.sh | 27 +------ cyberpanel_complete.sh | 27 +------ cyberpanel_simple.sh | 27 +------ cyberpanel_standalone.sh | 27 +------ install/install.py | 107 ++-------------------------- install/install_utils.py | 4 +- install/universal_os_fixes.py | 2 +- modules/os/detect.sh | 26 ++----- simple_install.sh | 24 +------ 14 files changed, 28 insertions(+), 285 deletions(-) diff --git a/CPScripts/mailscannerinstaller.sh b/CPScripts/mailscannerinstaller.sh index 3dea79612..76a20e02d 100644 --- a/CPScripts/mailscannerinstaller.sh +++ b/CPScripts/mailscannerinstaller.sh @@ -55,13 +55,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then Server_OS="CloudLinux" elif grep -q -E "Rocky Linux" /etc/os-release ; then Server_OS="RockyLinux" -elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 22.04.5|Ubuntu 24.04.3|Ubuntu 25.04|Ubuntu 25.10" /etc/os-release ; then +elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then Server_OS="Ubuntu" elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then Server_OS="openEuler" else echo -e "Unable to detect your system..." - echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 22.04.5, Ubuntu 24.04.3, Ubuntu 25.04, Ubuntu 25.10, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" exit fi diff --git a/CPScripts/mailscanneruninstaller.sh b/CPScripts/mailscanneruninstaller.sh index aa70fb74e..9eebad670 100644 --- a/CPScripts/mailscanneruninstaller.sh +++ b/CPScripts/mailscanneruninstaller.sh @@ -12,13 +12,13 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then Server_OS="CloudLinux" elif grep -q -E "Rocky Linux" /etc/os-release ; then Server_OS="RockyLinux" -elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04|Ubuntu 22.04.5|Ubuntu 24.04.3|Ubuntu 25.04|Ubuntu 25.10" /etc/os-release ; then +elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then Server_OS="Ubuntu" elif grep -q -E "openEuler 20.03|openEuler 22.03" /etc/os-release ; then Server_OS="openEuler" else echo -e "Unable to detect your system..." - echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, Ubuntu 22.04.5, Ubuntu 24.04.3, Ubuntu 25.04, Ubuntu 25.10, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" + echo -e "\nCyberPanel is supported on x86_64 based Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, Ubuntu 22.04, CentOS 7, CentOS 8, AlmaLinux 8, RockyLinux 8, CloudLinux 7, CloudLinux 8, openEuler 20.03, openEuler 22.03...\n" exit fi diff --git a/INSTALLER_SUMMARY.md b/INSTALLER_SUMMARY.md index 12681d126..458f6e0a3 100644 --- a/INSTALLER_SUMMARY.md +++ b/INSTALLER_SUMMARY.md @@ -92,11 +92,10 @@ bash <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/c ## 🔧 **Fixed Issues:** -### **✅ AlmaLinux 9/10 Support** +### **✅ AlmaLinux 9 Support** - Fixed `aspell` and `libc-client` dependency issues -- Proper package handling for AlmaLinux 9/10 +- Proper package handling for AlmaLinux 9 - Smart fallback for missing packages -- Comprehensive AlmaLinux 10 compatibility fixes ### **✅ Modular Architecture** - Each module under 500 lines (as requested) diff --git a/README.md b/README.md index 6184064fb..11a6adece 100755 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Fast • Secure • Scalable — Simplify hosting management with style. | OS family | Recommended / Supported | | -------------------------- | ----------------------: | -| Ubuntu 25.10, 25.04, 24.04.3, 24.04, 22.04.5, 22.04, 20.04 | ✅ Recommended | +| Ubuntu 24.04, 22.04, 20.04 | ✅ Recommended | | Debian 13, 12, 11 | ✅ Supported | | AlmaLinux 10, 9, 8 | ✅ Supported | | RockyLinux 9, 8 | ✅ Supported | diff --git a/cyberpanel.sh b/cyberpanel.sh index c1f54bb18..5655745f3 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -86,11 +86,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" - elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - SERVER_OS="AlmaLinux10" - OS_FAMILY="rhel" - PACKAGE_MANAGER="dnf" - print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -116,26 +111,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.10" - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.04" - elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - SERVER_OS="Ubuntu24043" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 24.04.3" - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -158,7 +133,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" return 1 fi diff --git a/cyberpanel_clean.sh b/cyberpanel_clean.sh index e87ed602b..34edb731a 100644 --- a/cyberpanel_clean.sh +++ b/cyberpanel_clean.sh @@ -78,11 +78,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" - elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - SERVER_OS="AlmaLinux10" - OS_FAMILY="rhel" - PACKAGE_MANAGER="dnf" - print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -108,26 +103,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.10" - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.04" - elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - SERVER_OS="Ubuntu24043" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 24.04.3" - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -150,7 +125,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" return 1 fi diff --git a/cyberpanel_complete.sh b/cyberpanel_complete.sh index ce149dffa..6d276d9c3 100644 --- a/cyberpanel_complete.sh +++ b/cyberpanel_complete.sh @@ -90,11 +90,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "$GREEN" "Detected: AlmaLinux 9" - elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - SERVER_OS="AlmaLinux10" - OS_FAMILY="rhel" - PACKAGE_MANAGER="dnf" - print_status "$GREEN" "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -120,26 +115,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "$GREEN" "Detected: Rocky Linux 8" - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.10" - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.04" - elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - SERVER_OS="Ubuntu24043" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 24.04.3" - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -162,7 +137,7 @@ detect_os() { print_status "$GREEN" "Detected: Debian GNU/Linux 11" else print_status "$RED" "❌ Unsupported OS detected" - print_status "$YELLOW" "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" + print_status "$YELLOW" "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" return 1 fi diff --git a/cyberpanel_simple.sh b/cyberpanel_simple.sh index ea86d3827..5f469dbf8 100644 --- a/cyberpanel_simple.sh +++ b/cyberpanel_simple.sh @@ -76,11 +76,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "Detected: AlmaLinux 9" - elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - SERVER_OS="AlmaLinux10" - OS_FAMILY="rhel" - PACKAGE_MANAGER="dnf" - print_status "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -106,26 +101,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "Detected: Rocky Linux 8" - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.10" - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 25.04" - elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - SERVER_OS="Ubuntu24043" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 24.04.3" - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -148,7 +123,7 @@ detect_os() { print_status "Detected: Debian GNU/Linux 11" else print_status "ERROR: Unsupported OS detected" - print_status "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" + print_status "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" return 1 fi diff --git a/cyberpanel_standalone.sh b/cyberpanel_standalone.sh index 3083cdea2..5951af816 100644 --- a/cyberpanel_standalone.sh +++ b/cyberpanel_standalone.sh @@ -89,11 +89,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="dnf" print_status "$GREEN" "Detected: AlmaLinux 9" - elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - SERVER_OS="AlmaLinux10" - OS_FAMILY="rhel" - PACKAGE_MANAGER="dnf" - print_status "$GREEN" "Detected: AlmaLinux 10" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then SERVER_OS="AlmaLinux8" OS_FAMILY="rhel" @@ -119,26 +114,6 @@ detect_os() { OS_FAMILY="rhel" PACKAGE_MANAGER="yum" print_status "$GREEN" "Detected: Rocky Linux 8" - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.10" - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.04" - elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - SERVER_OS="Ubuntu24043" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 24.04.3" - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 22.04.5" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then SERVER_OS="Ubuntu2204" OS_FAMILY="debian" @@ -161,7 +136,7 @@ detect_os() { print_status "$GREEN" "Detected: Debian GNU/Linux 11" else print_status "$RED" "❌ Unsupported OS detected" - print_status "$YELLOW" "Supported OS: AlmaLinux 8/9/10, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04/22.04.5/24.04.3/25.04/25.10, Debian 11/12" + print_status "$YELLOW" "Supported OS: AlmaLinux 8/9, CentOS 8/9, Rocky Linux 8/9, Ubuntu 20.04/22.04, Debian 11/12" return 1 fi diff --git a/install/install.py b/install/install.py index d213afa30..52d4c17b6 100644 --- a/install/install.py +++ b/install/install.py @@ -169,11 +169,6 @@ class preFlightsChecks: os_info = self.detect_os_info() return os_info['name'] == 'almalinux' and os_info['major_version'] == 9 - def is_almalinux10(self): - """Check if running on AlmaLinux 10""" - os_info = self.detect_os_info() - return os_info['name'] == 'almalinux' and os_info['major_version'] == 10 - def is_ubuntu(self): """Check if running on Ubuntu""" os_info = self.detect_os_info() @@ -197,7 +192,7 @@ class preFlightsChecks: if os_info['name'] == 'almalinux' and os_info['major_version'] == 9: fixes.extend(['mariadb', 'services', 'litespeed', 'mysql_gpg']) elif os_info['name'] == 'almalinux' and os_info['major_version'] == 10: - fixes.extend(['mariadb', 'services', 'litespeed', 'mysql_gpg']) + fixes.extend(['mariadb', 'services', 'litespeed']) elif os_info['name'] == 'rocky' and os_info['major_version'] >= 8: fixes.extend(['mariadb', 'services']) elif os_info['name'] == 'rhel' and os_info['major_version'] >= 8: @@ -321,10 +316,10 @@ class preFlightsChecks: if not installed: self.stdOut(f"Package {package} not available, trying alternatives...", 1) - # For AlmaLinux 9/10, try enabling PowerTools repository first - if self.distro == openeuler and os_info['name'] == 'almalinux' and os_info['major_version'] in ['9', '10']: + # For AlmaLinux 9, try enabling PowerTools repository first + if self.distro == openeuler and os_info['name'] == 'almalinux' and os_info['major_version'] == '9': try: - self.stdOut("Enabling AlmaLinux 9/10 PowerTools repository...", 1) + self.stdOut("Enabling AlmaLinux 9 PowerTools repository...", 1) self.call("dnf config-manager --set-enabled powertools", self.distro, "Enable PowerTools", "Enable PowerTools", 1, 0, os.EX_OSERR) # Try installing again with PowerTools enabled command = f"dnf install -y {package} {dev_package}" @@ -751,92 +746,6 @@ class preFlightsChecks: self.stdOut(f"Error in fix_debian_specific: {str(e)}", 0) return False - def fix_almalinux10_comprehensive(self): - """Apply comprehensive AlmaLinux 10 fixes""" - if not self.is_almalinux10(): - return - - self.stdOut("Applying comprehensive AlmaLinux 10 fixes...", 1) - - try: - # Update system packages - self.stdOut("Updating system packages...", 1) - command = "dnf update -y" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # Install essential build tools and dependencies - self.stdOut("Installing essential build tools...", 1) - command = "dnf groupinstall -y 'Development Tools'" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - command = "dnf install -y epel-release" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # Install AlmaLinux 10 compatibility packages (same as AlmaLinux 9) - self.stdOut("Installing AlmaLinux 10 compatibility packages...", 1) - compat_packages = [ - "libxcrypt-compat", - "libnsl", - "compat-openssl11", - "compat-openssl11-devel" - ] - - for package in compat_packages: - command = f"dnf install -y {package}" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # Install PHP dependencies that are missing (with AlmaLinux 10 compatibility) - self.stdOut("Installing PHP dependencies...", 1) - - # Base packages that should work on all systems - base_deps = [ - "ImageMagick", "ImageMagick-devel", - "gd", "gd-devel", - "libicu", "libicu-devel", - "oniguruma", "oniguruma-devel", - "aspell", "aspell-devel", - "freetype-devel", - "libjpeg-turbo-devel", - "libpng-devel", - "libwebp-devel", - "libXpm-devel", - "libzip-devel", - "libxml2-devel", - "openssl-devel", - "curl-devel", - "libxslt-devel", - "sqlite-devel", - "readline-devel", - "libedit-devel", - "pcre2-devel", - "re2c", - "libargon2-devel", - "libsodium-devel" - ] - - for package in base_deps: - command = f"dnf install -y {package}" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # Install MariaDB development packages - self.stdOut("Installing MariaDB development packages...", 1) - mariadb_deps = [ - "mariadb-devel", - "mariadb-connector-c-devel" - ] - - for package in mariadb_deps: - command = f"dnf install -y {package}" - self.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - self.stdOut("✅ AlmaLinux 10 fixes applied successfully", 1) - - except Exception as e: - self.stdOut(f"❌ Error applying AlmaLinux 10 fixes: {e}", 1) - return False - - return True - def apply_os_specific_fixes(self): """Apply OS-specific fixes based on detected OS""" try: @@ -1986,7 +1895,7 @@ class preFlightsChecks: # Use compatible repository version for RHEL-based systems # AlmaLinux 9 is compatible with el8 repositories os_info = self.detect_os_info() - if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9', '10']: + if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9']: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' else: command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' @@ -4532,7 +4441,7 @@ milter_default_action = accept # Use compatible repository version for RHEL-based systems # AlmaLinux 9 is compatible with el8 repositories os_info = self.detect_os_info() - if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9', '10']: + if os_info['name'] in ['almalinux', 'rocky', 'rhel'] and os_info['major_version'] in ['8', '9']: repo_command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' else: repo_command = 'rpm -Uvh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm' @@ -5589,11 +5498,9 @@ def main(): # Note: OS-specific fixes are now applied earlier in the installation process # The installCyberPanel.Main() functionality has been integrated into the main installation flow - # Apply AlmaLinux 9/10 comprehensive fixes first if needed + # Apply AlmaLinux 9 comprehensive fixes first if needed if checks.is_almalinux9(): checks.fix_almalinux9_comprehensive() - elif checks.is_almalinux10(): - checks.fix_almalinux10_comprehensive() # Install core services in the correct order checks.installLiteSpeed(ent, serial) diff --git a/install/install_utils.py b/install/install_utils.py index 546ee5085..07982c0c0 100644 --- a/install/install_utils.py +++ b/install/install_utils.py @@ -34,8 +34,6 @@ def FetchCloudLinuxAlmaVersionVersion(): return 'al-87' elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('9.4') > -1 or data.find('9.3') > -1 or data.find('Shamrock Pampas') > -1 or data.find('Seafoam Ocelot') > -1 or data.find('VERSION="9.') > -1): return 'al-93' - elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('10.0') > -1 or data.find('Purple Lion') > -1 or data.find('VERSION="10.') > -1): - return 'al-10' elif data.find('CentOS Stream 9') > -1: return 'el-9' elif data.find('CentOS Linux 9') > -1: @@ -44,6 +42,8 @@ def FetchCloudLinuxAlmaVersionVersion(): return 'el-9' elif data.find('Red Hat Enterprise Linux 9') > -1: return 'el-9' + elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (data.find('10.0') > -1 or data.find('Purple Lion') > -1 or data.find('VERSION="10.') > -1): + return 'al-100' else: return -1 diff --git a/install/universal_os_fixes.py b/install/universal_os_fixes.py index 979eb1373..eea45dc19 100644 --- a/install/universal_os_fixes.py +++ b/install/universal_os_fixes.py @@ -21,7 +21,7 @@ class UniversalOSFixes: # Supported OS matrix self.supported_os = { - 'ubuntu': ['25.10', '25.04', '24.04.3', '24.04', '22.04.5', '22.04', '20.04'], + 'ubuntu': ['24.04', '22.04', '20.04'], 'debian': ['13', '12', '11'], 'almalinux': ['10', '9', '8'], 'rocky': ['9', '8'], diff --git a/modules/os/detect.sh b/modules/os/detect.sh index 63b1db9c7..0d0d3550c 100644 --- a/modules/os/detect.sh +++ b/modules/os/detect.sh @@ -206,17 +206,11 @@ detect_ubuntu() { PACKAGE_MANAGER="apt" print_status "$GREEN" "Detected: Ubuntu 22.04" return 0 - elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - SERVER_OS="Ubuntu2510" + elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then + SERVER_OS="Ubuntu2404" OS_FAMILY="debian" PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.10" - return 0 - elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - SERVER_OS="Ubuntu2504" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 25.04" + print_status "$GREEN" "Detected: Ubuntu 24.04" return 0 elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then SERVER_OS="Ubuntu24043" @@ -224,18 +218,6 @@ detect_ubuntu() { PACKAGE_MANAGER="apt" print_status "$GREEN" "Detected: Ubuntu 24.04.3" return 0 - elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - SERVER_OS="Ubuntu22045" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 22.04.5" - return 0 - elif echo $OUTPUT | grep -q "Ubuntu 24.04" ; then - SERVER_OS="Ubuntu2404" - OS_FAMILY="debian" - PACKAGE_MANAGER="apt" - print_status "$GREEN" "Detected: Ubuntu 24.04" - return 0 fi return 1 } @@ -329,7 +311,7 @@ detect_os() { else print_status "$RED" "❌ Unable to detect your OS..." print_status "$YELLOW" "Supported operating systems:" - echo -e "• Ubuntu: 18.04, 20.04, 20.10, 22.04, 22.04.5, 24.04, 24.04.3, 25.04, 25.10" + echo -e "• Ubuntu: 18.04, 20.04, 20.10, 22.04, 24.04, 24.04.3" echo -e "• Debian: 11, 12, 13" echo -e "• AlmaLinux: 8, 9, 10" echo -e "• RockyLinux: 8, 9" diff --git a/simple_install.sh b/simple_install.sh index e65c49d33..3d3cdb5b8 100644 --- a/simple_install.sh +++ b/simple_install.sh @@ -10,30 +10,10 @@ if echo $OUTPUT | grep -q "AlmaLinux 9" ; then echo -e "\nDetecting AlmaLinux 9...\n" SERVER_OS="AlmaLinux9" PKG_MGR="dnf" -elif echo $OUTPUT | grep -q "AlmaLinux 10" ; then - echo -e "\nDetecting AlmaLinux 10...\n" - SERVER_OS="AlmaLinux10" - PKG_MGR="dnf" elif echo $OUTPUT | grep -q "AlmaLinux 8" ; then echo -e "\nDetecting AlmaLinux 8...\n" SERVER_OS="AlmaLinux8" PKG_MGR="yum" -elif echo $OUTPUT | grep -q "Ubuntu 25.10" ; then - echo -e "\nDetecting Ubuntu 25.10...\n" - SERVER_OS="Ubuntu2510" - PKG_MGR="apt" -elif echo $OUTPUT | grep -q "Ubuntu 25.04" ; then - echo -e "\nDetecting Ubuntu 25.04...\n" - SERVER_OS="Ubuntu2504" - PKG_MGR="apt" -elif echo $OUTPUT | grep -q "Ubuntu 24.04.3" ; then - echo -e "\nDetecting Ubuntu 24.04.3...\n" - SERVER_OS="Ubuntu24043" - PKG_MGR="apt" -elif echo $OUTPUT | grep -q "Ubuntu 22.04.5" ; then - echo -e "\nDetecting Ubuntu 22.04.5...\n" - SERVER_OS="Ubuntu22045" - PKG_MGR="apt" elif echo $OUTPUT | grep -q "Ubuntu 22.04" ; then echo -e "\nDetecting Ubuntu 22.04...\n" SERVER_OS="Ubuntu2204" @@ -48,8 +28,8 @@ elif echo $OUTPUT | grep -q "CentOS Linux 8" ; then PKG_MGR="yum" else echo -e "\nUnsupported OS detected. This script supports:\n" - echo -e "AlmaLinux: 8, 9, 10\n" - echo -e "Ubuntu: 20.04, 22.04, 22.04.5, 24.04.3, 25.04, 25.10\n" + echo -e "AlmaLinux: 8, 9\n" + echo -e "Ubuntu: 20.04, 22.04\n" echo -e "CentOS: 8\n" exit 1 fi From 293550c5885ea385dd025d597d6a6e08c22f9e81 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 16 Oct 2025 22:26:33 +0200 Subject: [PATCH 5/7] Enhance PHP support in installation and management scripts - Added installation logic for PHP 8.6 in the install script, ensuring compatibility with various distributions. - Updated PHP version lists in the PHPManager to include PHP 8.6 for system checks and fallbacks. - Modified phpUtilities to recognize PHP 8.6 for CentOS and Ubuntu. - Adjusted upgrade script to support PHP 8.6 for AlmaLinux 8+ compatibility. - Revised symlink setup logic to prioritize PHP 8.6 alongside other versions. --- install/install.py | 19 +++++++++++++++---- managePHP/phpManager.py | 12 ++++++------ plogical/phpUtilities.py | 6 ++++++ plogical/upgrade.py | 34 +++++++++++++++++----------------- 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/install/install.py b/install/install.py index 52d4c17b6..f36c904bd 100644 --- a/install/install.py +++ b/install/install.py @@ -4503,6 +4503,17 @@ milter_default_action = accept command = 'DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp85 lsphp85-*' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + + # Install PHP 8.6 + if not os.path.exists('/usr/local/lsws/lsphp86/bin/php'): + logging.InstallLog.writeToFile("[setupPHPSymlink] PHP 8.6 not found, ensuring it's installed...") + + if self.distro == centos or self.distro == cent8 or self.distro == openeuler: + command = 'dnf install lsphp86 lsphp86-* -y --skip-broken --nobest' + else: + command = 'DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp86 lsphp86-*' + + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) # Remove existing PHP symlink if it exists if os.path.exists('/usr/bin/php'): @@ -4510,8 +4521,8 @@ milter_default_action = accept # Create symlink to the best available PHP version # Try to find and use the best available PHP version - # Priority: 85 (beta), 84, 83, 82, 81, 80, 74 (newest to oldest) - php_versions = ['85', '84', '83', '82', '81', '80', '74'] + # Priority: 86, 85, 84, 83, 82, 81, 80, 74 (newest to oldest, 7.4+ only for AlmaLinux 8+ compatibility) + php_versions = ['86', '85', '84', '83', '82', '81', '80', '74'] php_symlink_source = None for php_ver in php_versions: @@ -4561,8 +4572,8 @@ milter_default_action = accept logging.InstallLog.writeToFile("[setup_lsphp_symlink] Removed existing lsphp file/symlink") # Try to find and use the best available PHP version - # Priority: 85 (beta), 84, 83, 82, 81, 80, 74 (newest to oldest) - php_versions = ['85', '84', '83', '82', '81', '80', '74'] + # Priority: 86, 85, 84, 83, 82, 81, 80, 74 (newest to oldest) + php_versions = ['86', '85', '84', '83', '82', '81', '80', '74'] lsphp_source = None for php_ver in php_versions: diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index ad03e017f..818b260a9 100644 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -58,7 +58,7 @@ class PHPManager: # Method 2: Check system-wide PHP installations try: # Check for system PHP versions - system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] for version in system_php_versions: formatted_version = f'PHP {version}' if formatted_version not in finalPHPVersions: @@ -117,7 +117,7 @@ class PHPManager: # Method 4: Fallback to checking common PHP versions if not finalPHPVersions: - fallback_versions = ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] + 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'] for version in fallback_versions: try: phpString = PHPManager.getPHPString(version) @@ -145,12 +145,12 @@ class PHPManager: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Final PHP versions found: {finalPHPVersions}') - 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'] + 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'] except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - return ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] + 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'] @staticmethod def findApachePHPVersions(): @@ -222,7 +222,7 @@ class PHPManager: except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - 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'] + 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'] @staticmethod def getPHPString(phpVersion): @@ -338,7 +338,7 @@ class PHPManager: return 'PHP 8.3' # Default recommendation # Priority order for recommendations - recommended_order = ['PHP 8.3', 'PHP 8.2', 'PHP 8.4', 'PHP 8.5', 'PHP 8.1', 'PHP 8.0', 'PHP 7.4'] + 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'] for recommended in recommended_order: if recommended in all_versions: diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 98041cd4b..692ba4b19 100644 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -373,6 +373,12 @@ class phpUtilities: ubuntuPHP = 'php8.5' + phpPath = ApacheVhost.DecidePHPPath('86', virtualHostName) + if os.path.exists(phpPath): + centOSPHP = 'php86' + ubuntuPHP = 'php8.6' + + ###### diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 7bdf0bded..6239027bf 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -3630,19 +3630,16 @@ echo $oConfig->Save() ? 'Done' : 'Error'; content = f.read() if 'release 9' in content or 'release 10' in content: Upgrade.stdOut("AlmaLinux 9+ detected - checking available PHP versions", 1) - # AlmaLinux 9+ doesn't have PHP 7.1, 7.2, 7.3 - php_versions = ['74', '80', '81', '82', '83', '84', '85'] + # AlmaLinux 9+ and 8+ only support PHP 7.4+ + php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] else: - php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] + php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] except: - php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] + php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] else: - # Check other OS versions + # Check other OS versions - all modern systems support PHP 7.4+ os_info = Upgrade.findOperatingSytem() - if os_info in [Ubuntu24, CENTOS8, Debian13]: - php_versions = ['74', '80', '81', '82', '83', '84', '85'] - else: - php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] + php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] # Check availability of each version available_versions = [] @@ -4119,8 +4116,8 @@ echo $oConfig->Save() ? 'Done' : 'Error'; package_list = f"lsphp{version} " + " ".join([f"lsphp{version}-{ext}" for ext in extensions]) command = f"yum install -y {package_list}" Upgrade.executioner(command, f'Install PHP {version}', 0) - elif version in ['80', '81', '82', '83', '84', '85']: - # PHP 8.x versions (including 8.5 beta) + elif version in ['80', '81', '82', '83', '84', '85', '86']: + # PHP 8.x versions (including 8.5 and 8.6) if Upgrade.installedOutput.find(f'lsphp{version}') == -1: command = f"yum install lsphp{version}* -y" subprocess.call(command, shell=True) @@ -4155,6 +4152,9 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp85*' os.system(command) + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp86*' + os.system(command) + CentOSPath = '/etc/redhat-release' openEulerPath = '/etc/openEuler-release' @@ -4726,8 +4726,8 @@ slowlog = /var/log/php{version}-fpm-slow.log This ensures that ImunifyAV/Imunify360 installation will work properly. """ try: - # Define all possible PHP versions - php_versions = ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + # Define all possible PHP versions (7.4+ for AlmaLinux 8+ compatibility) + php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] restarted_count = 0 total_count = 0 @@ -4774,8 +4774,8 @@ slowlog = /var/log/php{version}-fpm-slow.log def setupPHPSymlink(): try: # Try to find available PHP version (prioritize modern stable versions) - # Priority: 8.3 (recommended), 8.2, 8.4, 8.5, 8.1, 8.0, then older versions - php_versions = ['83', '82', '84', '85', '81', '80', '74', '73', '72', '71'] + # Priority: 8.3 (recommended), 8.2, 8.6, 8.5, 8.4, 8.1, 8.0, 7.4 (AlmaLinux 8+ compatible only) + php_versions = ['83', '82', '86', '85', '84', '81', '80', '74'] selected_php = None for version in php_versions: @@ -4995,8 +4995,8 @@ slowlog = /var/log/php{version}-fpm-slow.log except: pass - # Try to find available PHP binary in order of preference (modern stable first) - php_versions = ['83', '82', '84', '85', '81', '80', '74', '73', '72', '71'] + # Try to find available PHP binary in order of preference (modern stable first, AlmaLinux 8+ compatible) + php_versions = ['83', '82', '86', '85', '84', '81', '80', '74'] php_binary_found = False for version in php_versions: From 05bcb46fd65c0bcd83bdb8a50ab12666ff94874d Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 16 Oct 2025 22:34:18 +0200 Subject: [PATCH 6/7] Refactor CyberPanel installation logic to streamline PHP version handling - Removed local installation function in favor of a direct installation approach. - Updated installation script to prioritize the development branch for downloading CyberPanel, with a fallback to stable if unavailable. - Adjusted PHP version lists across various scripts to exclude PHP 8.6 and ensure compatibility with existing versions. - Enhanced error handling and feedback during installation to improve user experience. --- cyberpanel.sh | 93 +++++++++------------------------------- install/install.py | 19 ++------ managePHP/phpManager.py | 12 +++--- plogical/phpUtilities.py | 6 --- plogical/upgrade.py | 34 +++++++-------- 5 files changed, 48 insertions(+), 116 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 5655745f3..be7af7c01 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -572,31 +572,6 @@ cleanup_existing_cyberpanel() { echo " ✅ Cleanup completed" } -# Function to install CyberPanel from local repository -install_cyberpanel_local() { - echo " 🔄 Using local CyberPanel repository..." - - # Check if we're running from a cloned repository - if [ -d "install" ] && [ -f "install/install.py" ]; then - echo " ✓ Found local installation files" - echo " 🔄 Starting CyberPanel installation from local repository..." - echo "" - - # Run the Python installer directly - if [ "$DEBUG_MODE" = true ]; then - python3 install/install.py --debug - else - python3 install/install.py - fi - - return $? - else - echo " ⚠️ Local installation files not found" - echo " 🔄 Falling back to download method..." - install_cyberpanel_direct - fi -} - # Function to install CyberPanel directly using the working method install_cyberpanel_direct() { echo " 🔄 Downloading CyberPanel installation files..." @@ -636,20 +611,15 @@ install_cyberpanel_direct() { # Download the working CyberPanel installation files echo "Downloading from: https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" - # Default to stable branch, but use development if BRANCH_NAME is set - local installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" + # Try development branch first, fallback to stable + local installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" - # If BRANCH_NAME is set to v2.5.5-dev, try to use it - if [ "$BRANCH_NAME" = "v2.5.5-dev" ]; then - echo " Attempting to use development branch (v2.5.5-dev)..." - if curl -s -f -o /dev/null "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/README.md"; then - echo " Using development branch (v2.5.5-dev)" - installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" - else - echo " Development branch not available, falling back to stable" - fi + # Test if the development branch exists + if ! curl -s --head "$installer_url" | grep -q "200 OK"; then + echo " Development branch not available, falling back to stable" + installer_url="https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" else - echo " Using stable branch" + echo " Using development branch (v2.5.5-dev)" fi curl --silent -o cyberpanel_installer.sh "$installer_url" 2>/dev/null @@ -662,9 +632,9 @@ install_cyberpanel_direct() { # Download the install directory echo "Downloading installation files..." - local archive_url="https://github.com/usmannasir/cyberpanel/archive/stable.tar.gz" - if [ "$BRANCH_NAME" = "v2.5.5-dev" ] && [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" ]; then - archive_url="https://github.com/usmannasir/cyberpanel/archive/v2.5.5-dev.tar.gz" + local archive_url="https://github.com/usmannasir/cyberpanel/archive/v2.5.5-dev.tar.gz" + if [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" ]; then + archive_url="https://github.com/usmannasir/cyberpanel/archive/stable.tar.gz" fi curl --silent -L -o install_files.tar.gz "$archive_url" 2>/dev/null @@ -681,12 +651,12 @@ install_cyberpanel_direct() { fi # Copy install directory to current location - if [ "$BRANCH_NAME" = "v2.5.5-dev" ] && [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.5.5-dev/cyberpanel.sh" ]; then - cp -r cyberpanel-v2.5.5-dev/install . 2>/dev/null || true - cp -r cyberpanel-v2.5.5-dev/install.sh . 2>/dev/null || true - else + if [ "$installer_url" = "https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel.sh" ]; then cp -r cyberpanel-stable/install . 2>/dev/null || true cp -r cyberpanel-stable/install.sh . 2>/dev/null || true + else + cp -r cyberpanel-v2.5.5-dev/install . 2>/dev/null || true + cp -r cyberpanel-v2.5.5-dev/install.sh . 2>/dev/null || true fi echo " ✓ CyberPanel installation files downloaded" @@ -727,9 +697,9 @@ install_cyberpanel_direct() { # Run installer and show live output, capturing the password if [ "$DEBUG_MODE" = true ]; then - ./cyberpanel_installer.sh --debug --branch "$BRANCH_NAME" 2>&1 | tee /var/log/CyberPanel/install_output.log + ./cyberpanel_installer.sh --debug 2>&1 | tee /var/log/CyberPanel/install_output.log else - ./cyberpanel_installer.sh --branch "$BRANCH_NAME" 2>&1 | tee /var/log/CyberPanel/install_output.log + ./cyberpanel_installer.sh 2>&1 | tee /var/log/CyberPanel/install_output.log fi local install_exit_code=${PIPESTATUS[0]} @@ -2035,17 +2005,10 @@ start_reinstall() { # Install CyberPanel echo "Step 5/6: Installing CyberPanel..." - # Try local installation first if available - if [ -d "install" ] && [ -f "install/install.py" ]; then - install_cyberpanel_local - else - install_cyberpanel_direct - fi - - if [ $? -ne 0 ]; then + if ! install_cyberpanel; then print_status "ERROR: CyberPanel installation failed" - exit 1 - fi + exit 1 +fi echo "" # Apply fixes @@ -2083,14 +2046,7 @@ start_installation() { # Install CyberPanel echo "Step 3/6: Installing CyberPanel..." - # Try local installation first if available - if [ -d "install" ] && [ -f "install/install.py" ]; then - install_cyberpanel_local - else - install_cyberpanel_direct - fi - - if [ $? -ne 0 ]; then + if ! install_cyberpanel; then print_status "ERROR: CyberPanel installation failed" echo "" echo "Would you like to see troubleshooting help? (y/n) [y]: " @@ -2309,14 +2265,7 @@ main() { install_dependencies # Install CyberPanel - # Try local installation first if available - if [ -d "install" ] && [ -f "install/install.py" ]; then - install_cyberpanel_local - else - install_cyberpanel_direct - fi - - if [ $? -ne 0 ]; then + if ! install_cyberpanel; then print_status "ERROR: CyberPanel installation failed" echo "" echo "Would you like to see troubleshooting help? (y/n) [y]: " diff --git a/install/install.py b/install/install.py index f36c904bd..52d4c17b6 100644 --- a/install/install.py +++ b/install/install.py @@ -4503,17 +4503,6 @@ milter_default_action = accept command = 'DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp85 lsphp85-*' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # Install PHP 8.6 - if not os.path.exists('/usr/local/lsws/lsphp86/bin/php'): - logging.InstallLog.writeToFile("[setupPHPSymlink] PHP 8.6 not found, ensuring it's installed...") - - if self.distro == centos or self.distro == cent8 or self.distro == openeuler: - command = 'dnf install lsphp86 lsphp86-* -y --skip-broken --nobest' - else: - command = 'DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp86 lsphp86-*' - - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) # Remove existing PHP symlink if it exists if os.path.exists('/usr/bin/php'): @@ -4521,8 +4510,8 @@ milter_default_action = accept # Create symlink to the best available PHP version # Try to find and use the best available PHP version - # Priority: 86, 85, 84, 83, 82, 81, 80, 74 (newest to oldest, 7.4+ only for AlmaLinux 8+ compatibility) - php_versions = ['86', '85', '84', '83', '82', '81', '80', '74'] + # Priority: 85 (beta), 84, 83, 82, 81, 80, 74 (newest to oldest) + php_versions = ['85', '84', '83', '82', '81', '80', '74'] php_symlink_source = None for php_ver in php_versions: @@ -4572,8 +4561,8 @@ milter_default_action = accept logging.InstallLog.writeToFile("[setup_lsphp_symlink] Removed existing lsphp file/symlink") # Try to find and use the best available PHP version - # Priority: 86, 85, 84, 83, 82, 81, 80, 74 (newest to oldest) - php_versions = ['86', '85', '84', '83', '82', '81', '80', '74'] + # Priority: 85 (beta), 84, 83, 82, 81, 80, 74 (newest to oldest) + php_versions = ['85', '84', '83', '82', '81', '80', '74'] lsphp_source = None for php_ver in php_versions: diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index 818b260a9..ad03e017f 100644 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -58,7 +58,7 @@ class PHPManager: # Method 2: Check system-wide PHP installations try: # Check for system PHP versions - system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] + system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] for version in system_php_versions: formatted_version = f'PHP {version}' if formatted_version not in finalPHPVersions: @@ -117,7 +117,7 @@ class PHPManager: # Method 4: Fallback to checking common PHP versions if not finalPHPVersions: - 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'] + fallback_versions = ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] for version in fallback_versions: try: phpString = PHPManager.getPHPString(version) @@ -145,12 +145,12 @@ class PHPManager: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Final PHP versions found: {finalPHPVersions}') - 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'] + 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'] except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - 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'] + return ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] @staticmethod def findApachePHPVersions(): @@ -222,7 +222,7 @@ class PHPManager: except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - 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'] + 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'] @staticmethod def getPHPString(phpVersion): @@ -338,7 +338,7 @@ class PHPManager: return 'PHP 8.3' # Default recommendation # Priority order for recommendations - 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'] + recommended_order = ['PHP 8.3', 'PHP 8.2', 'PHP 8.4', 'PHP 8.5', 'PHP 8.1', 'PHP 8.0', 'PHP 7.4'] for recommended in recommended_order: if recommended in all_versions: diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 692ba4b19..98041cd4b 100644 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -373,12 +373,6 @@ class phpUtilities: ubuntuPHP = 'php8.5' - phpPath = ApacheVhost.DecidePHPPath('86', virtualHostName) - if os.path.exists(phpPath): - centOSPHP = 'php86' - ubuntuPHP = 'php8.6' - - ###### diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 6239027bf..7bdf0bded 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -3630,16 +3630,19 @@ echo $oConfig->Save() ? 'Done' : 'Error'; content = f.read() if 'release 9' in content or 'release 10' in content: Upgrade.stdOut("AlmaLinux 9+ detected - checking available PHP versions", 1) - # AlmaLinux 9+ and 8+ only support PHP 7.4+ - php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] + # AlmaLinux 9+ doesn't have PHP 7.1, 7.2, 7.3 + php_versions = ['74', '80', '81', '82', '83', '84', '85'] else: - php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] + php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] except: - php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] + php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] else: - # Check other OS versions - all modern systems support PHP 7.4+ + # Check other OS versions os_info = Upgrade.findOperatingSytem() - php_versions = ['74', '80', '81', '82', '83', '84', '85', '86'] + if os_info in [Ubuntu24, CENTOS8, Debian13]: + php_versions = ['74', '80', '81', '82', '83', '84', '85'] + else: + php_versions = ['71', '72', '73', '74', '80', '81', '82', '83', '84', '85'] # Check availability of each version available_versions = [] @@ -4116,8 +4119,8 @@ echo $oConfig->Save() ? 'Done' : 'Error'; package_list = f"lsphp{version} " + " ".join([f"lsphp{version}-{ext}" for ext in extensions]) command = f"yum install -y {package_list}" Upgrade.executioner(command, f'Install PHP {version}', 0) - elif version in ['80', '81', '82', '83', '84', '85', '86']: - # PHP 8.x versions (including 8.5 and 8.6) + elif version in ['80', '81', '82', '83', '84', '85']: + # PHP 8.x versions (including 8.5 beta) if Upgrade.installedOutput.find(f'lsphp{version}') == -1: command = f"yum install lsphp{version}* -y" subprocess.call(command, shell=True) @@ -4152,9 +4155,6 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp85*' os.system(command) - command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp86*' - os.system(command) - CentOSPath = '/etc/redhat-release' openEulerPath = '/etc/openEuler-release' @@ -4726,8 +4726,8 @@ slowlog = /var/log/php{version}-fpm-slow.log This ensures that ImunifyAV/Imunify360 installation will work properly. """ try: - # Define all possible PHP versions (7.4+ for AlmaLinux 8+ compatibility) - php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] + # Define all possible PHP versions + php_versions = ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] restarted_count = 0 total_count = 0 @@ -4774,8 +4774,8 @@ slowlog = /var/log/php{version}-fpm-slow.log def setupPHPSymlink(): try: # Try to find available PHP version (prioritize modern stable versions) - # Priority: 8.3 (recommended), 8.2, 8.6, 8.5, 8.4, 8.1, 8.0, 7.4 (AlmaLinux 8+ compatible only) - php_versions = ['83', '82', '86', '85', '84', '81', '80', '74'] + # Priority: 8.3 (recommended), 8.2, 8.4, 8.5, 8.1, 8.0, then older versions + php_versions = ['83', '82', '84', '85', '81', '80', '74', '73', '72', '71'] selected_php = None for version in php_versions: @@ -4995,8 +4995,8 @@ slowlog = /var/log/php{version}-fpm-slow.log except: pass - # Try to find available PHP binary in order of preference (modern stable first, AlmaLinux 8+ compatible) - php_versions = ['83', '82', '86', '85', '84', '81', '80', '74'] + # Try to find available PHP binary in order of preference (modern stable first) + php_versions = ['83', '82', '84', '85', '81', '80', '74', '73', '72', '71'] php_binary_found = False for version in php_versions: From cef0192af63b1fe9a3531a376db2a27893931141 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Thu, 16 Oct 2025 22:43:12 +0200 Subject: [PATCH 7/7] Update PHP version handling to include PHP 8.6 across scripts - Added PHP 8.6 to the list of system PHP versions and fallback versions in PHPManager. - Updated return values to include PHP 8.6 in case of errors or empty results. - Enhanced phpUtilities to recognize PHP 8.6 for CentOS and Ubuntu configurations. - Adjusted recommended PHP version order to prioritize PHP 8.6. --- managePHP/phpManager.py | 25 +++++++++---------------- plogical/phpUtilities.py | 5 ++++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index ad03e017f..74ebca609 100644 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -58,7 +58,7 @@ class PHPManager: # Method 2: Check system-wide PHP installations try: # Check for system PHP versions - system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + system_php_versions = ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6'] for version in system_php_versions: formatted_version = f'PHP {version}' if formatted_version not in finalPHPVersions: @@ -117,7 +117,7 @@ class PHPManager: # Method 4: Fallback to checking common PHP versions if not finalPHPVersions: - fallback_versions = ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] + 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'] for version in fallback_versions: try: phpString = PHPManager.getPHPString(version) @@ -145,25 +145,18 @@ class PHPManager: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Final PHP versions found: {finalPHPVersions}') - 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'] + 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'] except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - return ['PHP 7.4', 'PHP 8.0', 'PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'] + 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'] @staticmethod def findApachePHPVersions(): - # distro = ProcessUtilities.decideDistro() - # if distro == ProcessUtilities.centos: - # 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'] - # elif distro == ProcessUtilities.cent8: - # return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] - # elif distro == ProcessUtilities.ubuntu20: - # return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0', 'PHP 8.1'] - # else: - # 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'] - + """ + Dynamically detect available Apache PHP versions by scanning the system + """ try: # Run the shell command and capture the output @@ -222,7 +215,7 @@ class PHPManager: except BaseException as msg: from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging logging.writeToFile(f'Error while finding php versions on system: {str(msg)}') - 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'] + 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'] @staticmethod def getPHPString(phpVersion): @@ -338,7 +331,7 @@ class PHPManager: return 'PHP 8.3' # Default recommendation # Priority order for recommendations - recommended_order = ['PHP 8.3', 'PHP 8.2', 'PHP 8.4', 'PHP 8.5', 'PHP 8.1', 'PHP 8.0', 'PHP 7.4'] + 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'] for recommended in recommended_order: if recommended in all_versions: diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 98041cd4b..3834cc7a9 100644 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -372,7 +372,10 @@ class phpUtilities: centOSPHP = 'php85' ubuntuPHP = 'php8.5' - + phpPath = ApacheVhost.DecidePHPPath('86', virtualHostName) + if os.path.exists(phpPath): + centOSPHP = 'php86' + ubuntuPHP = 'php8.6' ######