diff --git a/CHANGELOG.md b/CHANGELOG.md index c61e2c2..c4db6ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.22.0 - [Unreleased] +#### Added + +- Add PHP 8.4 support + ### v3.21.3 - 2024-06-14 #### Added diff --git a/install b/install index 8233f44..3052da4 100755 --- a/install +++ b/install @@ -4,12 +4,12 @@ # ------------------------------------------------------------------------- # Website: https://wordops.net # GitHub: https://github.com/WordOps/WordOps -# Copyright (c) 2019-2024 - WordOps +# Copyright (c) 2019-2025 - WordOps # This script is licensed under M.I.T # ------------------------------------------------------------------------- # wget -qO wo wops.cc && sudo -E bash wo # ------------------------------------------------------------------------- -# Version 3.21.3 - 2024-06-14 +# Version 3.22.0 - 2024-12-03 # ------------------------------------------------------------------------- # CONTENTS diff --git a/setup.py b/setup.py index eee876f..f011f33 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ if os.geteuid() == 0: os.makedirs('/var/lib/wo/tmp/') setup(name='wordops', - version='3.21.3', + version='3.22.0', description='An essential toolset that eases server administration', long_description=LONG, long_description_content_type='text/markdown', diff --git a/tests/travis.sh b/tests/travis.sh index 42ecbab..3d353de 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -17,7 +17,7 @@ wo_distro=$(lsb_release -sc) if [ -z "$1" ]; then { - apt-get -qq purge mysql* graphviz* redis* php73-* php-* + apt-get -qq purge mysql* graphviz* redis* php73-* php* php-* apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree sudo apt-get -qq autoremove --purge } >/dev/null 2>&1 @@ -32,7 +32,7 @@ echo -e "${CGREEN}#############################################${CEND}" echo -e ' stack install ' echo -e "${CGREEN}#############################################${CEND}" -stack_list='nginx php php74 php80 php81 php82 php83 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer redis phpredisadmin mysqltuner utils ufw cheat nanorc' +stack_list='nginx php php74 php80 php81 php82 php83 php84 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer redis phpredisadmin mysqltuner utils ufw cheat nanorc' for stack in $stack_list; do echo -ne " Installing $stack [..]\r" @@ -52,7 +52,7 @@ done echo -e "${CGREEN}#############################################${CEND}" echo -e ' Simple site create ' echo -e "${CGREEN}#############################################${CEND}" -site_types='html php php74 php80 php81 php82 php83 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker' +site_types='html php php74 php80 php81 php82 php83 php84 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker' for site in $site_types; do echo -ne " Creating $site [..]\r" if { @@ -116,7 +116,7 @@ echo echo -e "${CGREEN}#############################################${CEND}" echo -e ' wo site update --php74 ' echo -e "${CGREEN}#############################################${CEND}" -other_site_types='mysql php81 php82 php83 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' +other_site_types='mysql php81 php82 php83 php84 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' for site in $other_site_types; do echo -ne " Updating site to $site php74 [..]\r" if { @@ -147,7 +147,7 @@ echo echo -e "${CGREEN}#############################################${CEND}" echo -e ' wo site update --php80 ' echo -e "${CGREEN}#############################################${CEND}" -other_site_types='mysql php81 php82 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' +other_site_types='mysql php81 php82 php84 wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' for site in $other_site_types; do echo -ne " Updating site to $site php80 [..]\r" if { @@ -195,7 +195,28 @@ other_site_types='mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' for site in $other_site_types; do echo -ne " Updating site to $site php82 [..]\r" if { - wo site update ${site}.net --php81 + wo site update ${site}.net --php82 + } >>/var/log/wo/test.log; then + echo -ne " Updating site to $site php82 [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " Updating site to $site php82 [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + + fi +done +echo +echo -e "${CGREEN}#############################################${CEND}" +echo +echo -e "${CGREEN}#############################################${CEND}" +echo -e ' wo site update --php84 ' +echo -e "${CGREEN}#############################################${CEND}" +other_site_types='mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir' +for site in $other_site_types; do + echo -ne " Updating site to $site php84 [..]\r" + if { + wo site update ${site}.net --php84 } >>/var/log/wo/test.log; then echo -ne " Updating site to $site php82 [${CGREEN}OK${CEND}]\\r" echo -ne '\n' @@ -275,7 +296,7 @@ if [ -z "$1" ]; then echo -e "${CGREEN}#############################################${CEND}" echo -e ' wo stack upgrade ' echo -e "${CGREEN}#############################################${CEND}" - stack_upgrade='nginx php php74 php80 php81 php82 mysql redis netdata dashboard phpmyadmin adminer fail2ban composer ngxblocker mysqltuner' + stack_upgrade='nginx php php74 php80 php81 php82 php84 mysql redis netdata dashboard phpmyadmin adminer fail2ban composer ngxblocker mysqltuner' for stack in $stack_upgrade; do echo -ne " Upgrading $stack [..]\r" if { @@ -430,7 +451,7 @@ cat /etc/apt/sources.list.d/redis.list echo -e "${CGREEN}#############################################${CEND}" echo -e ' wo stack purge ' echo -e "${CGREEN}#############################################${CEND}" -stack_purge='nginx php php74 php80 php81 php82 php83 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc' +stack_purge='nginx php php74 php80 php81 php82 php83 php84 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis ufw ngxblocker cheat nanorc' for stack in $stack_purge; do echo -ne " purging $stack [..]\r" if { diff --git a/wo/cli/plugins/info.py b/wo/cli/plugins/info.py index 5df6ef8..e1fbe1d 100644 --- a/wo/cli/plugins/info.py +++ b/wo/cli/plugins/info.py @@ -90,6 +90,10 @@ class WOInfoController(CementBaseController): pargs.php83 = True else: Log.info(self, "PHP 8.3 is not installed") + if WOAptGet.is_installed(self, 'php8.4-fpm'): + pargs.php84 = True + else: + Log.info(self, "PHP 8.4 is not installed") if pargs.php74: self.info_php74() @@ -101,6 +105,8 @@ class WOInfoController(CementBaseController): self.info_php82() if pargs.php83: self.info_php83() + if pargs.php84: + self.info_php84() @expose(hide=True) def info_php74(self): @@ -537,6 +543,93 @@ class WOInfoController(CementBaseController): debug_xdebug_profiler_enable_trigger=debug_xdebug) self.app.render((data), 'info_php.mustache') + @expose(hide=True) + def info_php84(self): + """Display PHP information""" + version = os.popen("/usr/bin/php8.4 -v 2>/dev/null | " + "head -n1 | cut -d' ' -f2 |" + " cut -d'+' -f1 | tr -d '\n'").read + config = configparser.ConfigParser() + config.read('/etc/php/8.4/fpm/php.ini') + expose_php = config['PHP']['expose_php'] + memory_limit = config['PHP']['memory_limit'] + post_max_size = config['PHP']['post_max_size'] + upload_max_filesize = config['PHP']['upload_max_filesize'] + max_execution_time = config['PHP']['max_execution_time'] + + if os.path.exists('/etc/php/8.4/fpm/pool.d/www.conf'): + config.read('/etc/php/8.4/fpm/pool.d/www.conf') + else: + Log.error(self, 'php-fpm pool config not found') + if config.has_section('www'): + wconfig = config['www'] + elif config.has_section('www-php84'): + wconfig = config['www-php84'] + else: + Log.error(self, 'Unable to parse configuration') + www_listen = wconfig['listen'] + www_ping_path = wconfig['ping.path'] + www_pm_status_path = wconfig['pm.status_path'] + www_pm = wconfig['pm'] + www_pm_max_requests = wconfig['pm.max_requests'] + www_pm_max_children = wconfig['pm.max_children'] + www_pm_start_servers = wconfig['pm.start_servers'] + www_pm_min_spare_servers = wconfig['pm.min_spare_servers'] + www_pm_max_spare_servers = wconfig['pm.max_spare_servers'] + www_request_terminate_time = (wconfig + ['request_terminate_timeout']) + try: + www_xdebug = (wconfig + ['php_admin_flag[xdebug.profiler_enable' + '_trigger]']) + except Exception as e: + Log.debug(self, "{0}".format(e)) + www_xdebug = 'off' + + config.read('/etc/php/8.4/fpm/pool.d/debug.conf') + debug_listen = config['debug']['listen'] + debug_ping_path = config['debug']['ping.path'] + debug_pm_status_path = config['debug']['pm.status_path'] + debug_pm = config['debug']['pm'] + debug_pm_max_requests = config['debug']['pm.max_requests'] + debug_pm_max_children = config['debug']['pm.max_children'] + debug_pm_start_servers = config['debug']['pm.start_servers'] + debug_pm_min_spare_servers = config['debug']['pm.min_spare_servers'] + debug_pm_max_spare_servers = config['debug']['pm.max_spare_servers'] + debug_request_terminate = (config['debug'] + ['request_terminate_timeout']) + try: + debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' + 'enable_trigger]']) + except Exception as e: + Log.debug(self, "{0}".format(e)) + debug_xdebug = 'off' + + data = dict(version=version, expose_php=expose_php, + memory_limit=memory_limit, post_max_size=post_max_size, + upload_max_filesize=upload_max_filesize, + max_execution_time=max_execution_time, + www_listen=www_listen, www_ping_path=www_ping_path, + www_pm_status_path=www_pm_status_path, www_pm=www_pm, + www_pm_max_requests=www_pm_max_requests, + www_pm_max_children=www_pm_max_children, + www_pm_start_servers=www_pm_start_servers, + www_pm_min_spare_servers=www_pm_min_spare_servers, + www_pm_max_spare_servers=www_pm_max_spare_servers, + www_request_terminate_timeout=www_request_terminate_time, + www_xdebug_profiler_enable_trigger=www_xdebug, + debug_listen=debug_listen, debug_ping_path=debug_ping_path, + debug_pm_status_path=debug_pm_status_path, + debug_pm=debug_pm, + debug_pm_max_requests=debug_pm_max_requests, + debug_pm_max_children=debug_pm_max_children, + debug_pm_start_servers=debug_pm_start_servers, + debug_pm_min_spare_servers=debug_pm_min_spare_servers, + debug_pm_max_spare_servers=debug_pm_max_spare_servers, + debug_request_terminate_timeout=debug_request_terminate, + debug_xdebug_profiler_enable_trigger=debug_xdebug) + self.app.render((data), 'info_php.mustache') + @expose(hide=True) def info_mysql(self): """Display MySQL information""" diff --git a/wo/cli/plugins/site_create.py b/wo/cli/plugins/site_create.py index 06dd5bf..648436d 100644 --- a/wo/cli/plugins/site_create.py +++ b/wo/cli/plugins/site_create.py @@ -225,7 +225,7 @@ class WOSiteCreateController(CementBaseController): data['subsiteof_webroot'] = parent_site_info.site_path if (pargs.php74 or pargs.php80 or pargs.php81 or - pargs.php82 or pargs.php83): + pargs.php82 or pargs.php83 or pargs.php84): data = dict( site_name=wo_domain, www_domain=wo_www_domain, static=False, basic=False, diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 18fe797..ccb409b 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -775,7 +775,7 @@ def sitebackup(self, data): .format(data['site_name']), backup_path) if data['currsitetype'] in ['html', 'php', 'php72', 'php74', - 'php73', 'php80', 'php81', 'php82', 'php83' + 'php73', 'php80', 'php81', 'php82', 'php83', 'php84' 'proxy', 'mysql']: if not data['wp']: Log.info(self, "Backing up Webroot \t\t", end='') @@ -836,7 +836,7 @@ def site_package_check(self, stype): stack.app = self.app pargs = self.app.pargs if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir', - 'wpsubdomain', 'php74', 'php80', 'php81', 'php82', 'php83', 'alias', 'subsite']: + 'wpsubdomain', 'php74', 'php80', 'php81', 'php82', 'php83', 'php84', 'alias', 'subsite']: Log.debug(self, "Setting apt_packages variable for Nginx") # Check if server has nginx-custom package @@ -872,7 +872,7 @@ def site_package_check(self, stype): wo_nginx.write('fastcgi_param \tSCRIPT_FILENAME ' '\t$request_filename;\n') - php_versions = ['php74', 'php80', 'php81', 'php82', 'php83'] + php_versions = ['php74', 'php80', 'php81', 'php82', 'php83', 'php84'] selected_versions = [version for version in php_versions if getattr(pargs, version)] if len(selected_versions) > 1: @@ -881,7 +881,7 @@ def site_package_check(self, stype): if ((not pargs.php74) and (not pargs.php80) and (not pargs.php81) and (not pargs.php82) and - (not pargs.php83) and + (not pargs.php83) and (not pargs.php84) and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']): Log.debug(self, "Setting apt_packages variable for PHP") @@ -1080,7 +1080,7 @@ def detSitePar(opts): for key, val in opts.items(): if val and key in ['html', 'php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain', - 'php74', 'php80', 'php81', 'php82', 'php83']: + 'php74', 'php80', 'php81', 'php82', 'php83', 'php84']: typelist.append(key) elif val and key in ['wpfc', 'wpsc', 'wpredis', 'wprocket', 'wpce']: cachelist.append(key) @@ -1126,6 +1126,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('php84', 'mysql', 'html') for x in typelist]: + sitetype = 'mysql' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('php', 'mysql') for x in typelist]: sitetype = 'mysql' if not cachelist: @@ -1162,6 +1168,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('php84', 'mysql') for x in typelist]: + sitetype = 'mysql' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('html', 'mysql') for x in typelist]: sitetype = 'mysql' if not cachelist: @@ -1216,6 +1228,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('wp', 'php84') for x in typelist]: + sitetype = 'wp' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('wpsubdir', 'php74') for x in typelist]: sitetype = 'wpsubdir' if not cachelist: @@ -1246,6 +1264,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('wpsubdir', 'php84') for x in typelist]: + sitetype = 'wpsubdir' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] elif False not in [x in ('wpsubdomain', 'php74') for x in typelist]: sitetype = 'wpsubdomain' if not cachelist: @@ -1276,6 +1300,12 @@ def detSitePar(opts): cachetype = 'basic' else: cachetype = cachelist[0] + elif False not in [x in ('wpsubdomain', 'php84') for x in typelist]: + sitetype = 'wpsubdomain' + if not cachelist: + cachetype = 'basic' + else: + cachetype = cachelist[0] else: raise RuntimeError("could not determine site and cache type") else: @@ -1297,6 +1327,9 @@ def detSitePar(opts): elif (not typelist or "php83" in typelist) and cachelist: sitetype = 'wp' cachetype = cachelist[0] + elif (not typelist or "php84" in typelist) and cachelist: + sitetype = 'wp' + cachetype = cachelist[0] elif typelist and (not cachelist): sitetype = typelist[0] cachetype = 'basic' diff --git a/wo/cli/plugins/site_update.py b/wo/cli/plugins/site_update.py index 28e76e9..83201e0 100644 --- a/wo/cli/plugins/site_update.py +++ b/wo/cli/plugins/site_update.py @@ -198,7 +198,7 @@ class WOSiteUpdateController(CementBaseController): pargs.ngxblocker or pargs.letsencrypt == 'renew') and not ( pargs.html or pargs.php or pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or - pargs.php83 or pargs.mysql or pargs.wp or pargs.wpfc or pargs.wpsc or + pargs.php83 or pargs.php84 or pargs.mysql or pargs.wp or pargs.wpfc or pargs.wpsc or pargs.wprocket or pargs.wpce or pargs.wpsubdir or pargs.wpsubdomain)): @@ -268,19 +268,19 @@ class WOSiteUpdateController(CementBaseController): if (((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php', 'php74', 'php80', - 'php81', 'php82', 'php83']) or + 'php81', 'php82', 'php83', 'php84']) or (stype == 'mysql' and oldsitetype not in [ 'html', 'php', 'php74', 'php80', 'php81', - 'php82', 'php83', 'proxy']) or + 'php82', 'php83', 'php84', 'proxy']) or (stype == 'wp' and oldsitetype not in [ 'html', 'php', 'php74', 'php80', 'php81', - 'php82', 'php83', 'mysql', 'proxy', 'wp']) or + 'php82', 'php83', 'php84', 'mysql', 'proxy', 'wp']) or (stype == 'wpsubdir' and oldsitetype in ['wpsubdomain']) or (stype == 'wpsubdomain' and oldsitetype in ['wpsubdir']) or (stype == oldsitetype and cache == oldcachetype)) and not (pargs.php74 or pargs.php80 or pargs.php81 or pargs.php82 or - pargs.php83 or pargs.alias)): + pargs.php83 or pargs.php84 or pargs.alias)): Log.info(self, Log.FAIL + "can not update {0} {1} to {2} {3}". format(oldsitetype, oldcachetype, stype, cache)) return 1 @@ -338,7 +338,7 @@ class WOSiteUpdateController(CementBaseController): site_name=wo_domain, www_domain=wo_www_domain, static=False, basic=True, wp=False, wpfc=False, php74=False, php80=False, php81=False, php82=False, php83=False, - wpsc=False, wpredis=False, wprocket=False, wpce=False, + php84=False, wpsc=False, wpredis=False, wprocket=False, wpce=False, multisite=False, wpsubdir=False, webroot=wo_site_webroot, currsitetype=oldsitetype, currcachetype=oldcachetype) @@ -362,11 +362,11 @@ class WOSiteUpdateController(CementBaseController): data['wpsubdir'] = True if ((pargs.php74 or pargs.php80 or pargs.php81 or - pargs.php82 or pargs.php83) and + pargs.php82 or pargs.php83 or pargs.php84) and (not data)): Log.debug( self, "pargs php74, " - "or php80, or php81 or php82 or php83 enabled") + "or php80, or php81 or php82 or php83 or php84 enabled") data = dict( site_name=wo_domain, www_domain=wo_www_domain, @@ -383,7 +383,8 @@ class WOSiteUpdateController(CementBaseController): elif (oldsitetype == 'php' or oldsitetype == 'mysql' or oldsitetype == 'php73' or oldsitetype == 'php74' or oldsitetype == 'php80' or oldsitetype == 'php81' or - oldsitetype == 'php82' or oldsitetype == 'php83'): + oldsitetype == 'php82' or oldsitetype == 'php83' or + oldsitetype == 'php84'): data['static'] = False data['wp'] = False data['multisite'] = False @@ -435,7 +436,7 @@ class WOSiteUpdateController(CementBaseController): if (data and (not pargs.php74) and (not pargs.php80) and (not pargs.php81) and (not pargs.php82) - and (not pargs.php83)): + and (not pargs.php83) and (not pargs.php84)): data[pargs_version] = bool(old_version_var is True) Log.debug( self, f"data {pargs_version} = {data[pargs_version]}") @@ -795,7 +796,7 @@ class WOSiteUpdateController(CementBaseController): # Setup WordPress if old sites are html/php/mysql sites if data['wp'] and oldsitetype in ['html', 'proxy', 'php', 'php72', 'mysql', 'php73', 'php74', 'php80', - 'php81', 'php82', 'php83']: + 'php81', 'php82', 'php83', 'php84']: try: wo_wp_creds = setupwordpress(self, data) except SiteError as e: diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 8c98c3d..8c8d272 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -135,6 +135,7 @@ class WOStackController(CementBaseController): pargs.php81 = True pargs.php82 = True pargs.php83 = True + pargs.php84 = True pargs.redis = True pargs.proftpd = True @@ -192,6 +193,7 @@ class WOStackController(CementBaseController): 'php81': WOVar.wo_php81, 'php82': WOVar.wo_php82, 'php83': WOVar.wo_php83, + 'php84': WOVar.wo_php84, } for parg_version, version in WOVar.wo_php_versions.items(): @@ -477,7 +479,8 @@ class WOStackController(CementBaseController): WOAptGet.is_installed(self, 'php8.0-fpm') or WOAptGet.is_installed(self, 'php8.1-fpm') or WOAptGet.is_installed(self, 'php8.2-fpm') or - WOAptGet.is_installed(self, 'php8.3-fpm')): + WOAptGet.is_installed(self, 'php8.3-fpm') or + WOAptGet.is_installed(self, 'php8.4-fpm')): pargs.php = True Log.debug(self, "Setting packages variable for utils") packages = packages + [[ @@ -577,6 +580,7 @@ class WOStackController(CementBaseController): pargs.php81 = True pargs.php82 = True pargs.php83 = True + pargs.php84 = True pargs.fail2ban = True pargs.proftpd = True pargs.utils = True @@ -618,6 +622,7 @@ class WOStackController(CementBaseController): 'php81': WOVar.wo_php81, 'php82': WOVar.wo_php82, 'php83': WOVar.wo_php83, + 'php84': WOVar.wo_php84, } # Loop through all versions. @@ -898,6 +903,7 @@ class WOStackController(CementBaseController): pargs.php81 = True pargs.php82 = True pargs.php83 = True + pargs.php84 = True pargs.fail2ban = True pargs.proftpd = True pargs.utils = True @@ -939,6 +945,7 @@ class WOStackController(CementBaseController): 'php81': WOVar.wo_php81, 'php82': WOVar.wo_php82, 'php83': WOVar.wo_php83, + 'php84': WOVar.wo_php84, } for parg_version, version in WOVar.wo_php_versions.items(): diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 1f0f82b..06eb1a7 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -85,7 +85,8 @@ def pre_pref(self, apt_packages): ('php8.0-fpm' in apt_packages) or ('php8.1-fpm' in apt_packages) or ('php8.2-fpm' in apt_packages) or - ('php8.3-fpm' in apt_packages)): + ('php8.3-fpm' in apt_packages) or + ('php8.4-fpm' in apt_packages)): if (WOVar.wo_distro == 'ubuntu'): Log.debug(self, 'Adding ppa for PHP') Log.info(self, "Adding repository for PHP, please wait...") diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index 8a633f3..75ac10d 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -107,6 +107,7 @@ class WOStackUpgradeController(CementBaseController): pargs.php81 = True pargs.php82 = True pargs.php83 = True + pargs.php84 = True pargs.mysql = True pargs.wpcli = True @@ -140,6 +141,7 @@ class WOStackUpgradeController(CementBaseController): 'php81': WOVar.wo_php81, 'php82': WOVar.wo_php82, 'php83': WOVar.wo_php83, + 'php84': WOVar.wo_php84, } for parg_version, version in WOVar.wo_php_versions.items(): @@ -279,6 +281,7 @@ class WOStackUpgradeController(CementBaseController): "php8.1-fpm" in apt_packages or "php8.2-fpm" in apt_packages or "php8.3-fpm" in apt_packages or + "php8.4-fpm" in apt_packages or "redis-server" in apt_packages or "nginx-custom" in apt_packages or "mariadb-server" in apt_packages): diff --git a/wo/cli/templates/upstream.mustache b/wo/cli/templates/upstream.mustache index fa5cd8b..15b15ea 100644 --- a/wo/cli/templates/upstream.mustache +++ b/wo/cli/templates/upstream.mustache @@ -165,6 +165,26 @@ upstream debug83 { server 127.0.0.1:9178; } +#------------------------------- +# PHP 8.4 +#------------------------------- + +# PHP 8.4 upstream with load-balancing on two unix sockets +upstream php84 { + least_conn; + + server unix:/var/run/php/php84-fpm.sock; + server unix:/var/run/php/php84-two-fpm.sock; + + keepalive 5; +} + +# PHP 8.4 debug +upstream debug83 { + # Debug Pool + server 127.0.0.1:9179; +} + #------------------------------- # Netdata #------------------------------- @@ -198,4 +218,5 @@ upstream multiphp { server unix:/var/run/php/php81-fpm.sock; server unix:/var/run/php/php82-fpm.sock; server unix:/var/run/php/php83-fpm.sock; + server unix:/var/run/php/php84-fpm.sock; } diff --git a/wo/core/services.py b/wo/core/services.py index c8f3878..8afdb8d 100644 --- a/wo/core/services.py +++ b/wo/core/services.py @@ -171,6 +171,7 @@ class WOService(): 'php8.1-fpm', 'php8.2-fpm', 'php8.3-fpm', + 'php8.4-fpm', ]: retcode = subprocess.getstatusoutput('service {0} status' .format(service_name)) diff --git a/wo/core/variables.py b/wo/core/variables.py index 22b3d11..04d9209 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -15,7 +15,7 @@ class WOVar(): """Intialization of core variables""" # WordOps version - wo_version = "3.21.3" + wo_version = "3.22.0" # WordOps packages versions wo_adminer = "4.8.1" wo_phpmyadmin = "5.2.0" @@ -149,6 +149,7 @@ class WOVar(): 'php81': '8.1', 'php82': '8.2', 'php83': '8.3', + 'php84': '8.4', } def generate_php_modules(version_prefix, version_number): @@ -169,6 +170,7 @@ class WOVar(): wo_php81 = generate_php_modules('php81', '8.1') wo_php82 = generate_php_modules('php82', '8.2') wo_php83 = generate_php_modules('php83', '8.3') + wo_php84 = generate_php_modules('php84', '8.4') wo_php_extra = ["graphviz"]