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: