Merge pull request #604 from gabrielgiordan/master
Fix PHP{version}-FPM is not installed and fix support for php 8.3
This commit is contained in:
@@ -588,6 +588,93 @@ class WOInfoController(CementBaseController):
|
|||||||
debug_xdebug_profiler_enable_trigger=debug_xdebug)
|
debug_xdebug_profiler_enable_trigger=debug_xdebug)
|
||||||
self.app.render((data), 'info_php.mustache')
|
self.app.render((data), 'info_php.mustache')
|
||||||
|
|
||||||
|
@expose(hide=True)
|
||||||
|
def info_php83(self):
|
||||||
|
"""Display PHP information"""
|
||||||
|
version = os.popen("/usr/bin/php8.3 -v 2>/dev/null | "
|
||||||
|
"head -n1 | cut -d' ' -f2 |"
|
||||||
|
" cut -d'+' -f1 | tr -d '\n'").read
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read('/etc/php/8.3/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.3/fpm/pool.d/www.conf'):
|
||||||
|
config.read('/etc/php/8.3/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-php83'):
|
||||||
|
wconfig = config['www-php83']
|
||||||
|
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.3/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)
|
@expose(hide=True)
|
||||||
def info_mysql(self):
|
def info_mysql(self):
|
||||||
"""Display MySQL information"""
|
"""Display MySQL information"""
|
||||||
@@ -689,6 +776,12 @@ class WOInfoController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP 8.2 is not installed")
|
Log.info(self, "PHP 8.2 is not installed")
|
||||||
|
|
||||||
|
if pargs.php83:
|
||||||
|
if WOAptGet.is_installed(self, 'php8.3-fpm'):
|
||||||
|
self.info_php83()
|
||||||
|
else:
|
||||||
|
Log.info(self, "PHP 8.3 is not installed")
|
||||||
|
|
||||||
if pargs.mysql:
|
if pargs.mysql:
|
||||||
if WOShellExec.cmd_exec(self, "/usr/bin/mysqladmin ping"):
|
if WOShellExec.cmd_exec(self, "/usr/bin/mysqladmin ping"):
|
||||||
self.info_mysql()
|
self.info_mysql()
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
pargs.netdata = True
|
pargs.netdata = True
|
||||||
pargs.ufw = True
|
pargs.ufw = True
|
||||||
|
|
||||||
|
if pargs.php:
|
||||||
|
if self.app.config.has_section('php'):
|
||||||
|
config_php_ver = self.app.config.get(
|
||||||
|
'php', 'version')
|
||||||
|
current_php = config_php_ver.replace(".", "")
|
||||||
|
setattr(self.app.pargs, 'php{0}'.format(current_php), True)
|
||||||
|
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
@@ -99,6 +106,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
pargs.php = True
|
pargs.php = True
|
||||||
pargs.mysql = True
|
pargs.mysql = True
|
||||||
|
|
||||||
|
if pargs.php:
|
||||||
|
if self.app.config.has_section('php'):
|
||||||
|
config_php_ver = self.app.config.get(
|
||||||
|
'php', 'version')
|
||||||
|
current_php = config_php_ver.replace(".", "")
|
||||||
|
setattr(self.app.pargs, 'php{0}'.format(current_php), True)
|
||||||
|
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
@@ -171,6 +185,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
pargs.mysql = True
|
pargs.mysql = True
|
||||||
pargs.netdata = True
|
pargs.netdata = True
|
||||||
|
|
||||||
|
if pargs.php:
|
||||||
|
if self.app.config.has_section('php'):
|
||||||
|
config_php_ver = self.app.config.get(
|
||||||
|
'php', 'version')
|
||||||
|
current_php = config_php_ver.replace(".", "")
|
||||||
|
setattr(self.app.pargs, 'php{0}'.format(current_php), True)
|
||||||
|
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
@@ -321,6 +342,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
pargs.mysql = True
|
pargs.mysql = True
|
||||||
pargs.fail2ban = True
|
pargs.fail2ban = True
|
||||||
|
|
||||||
|
if pargs.php:
|
||||||
|
if self.app.config.has_section('php'):
|
||||||
|
config_php_ver = self.app.config.get(
|
||||||
|
'php', 'version')
|
||||||
|
current_php = config_php_ver.replace(".", "")
|
||||||
|
setattr(self.app.pargs, 'php{0}'.format(current_php), True)
|
||||||
|
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
if os.path.exists('{0}'.format(wo_system) + 'nginx.service'):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ class WOService():
|
|||||||
'php8.0-fpm',
|
'php8.0-fpm',
|
||||||
'php8.1-fpm',
|
'php8.1-fpm',
|
||||||
'php8.2-fpm',
|
'php8.2-fpm',
|
||||||
|
'php8.3-fpm',
|
||||||
]:
|
]:
|
||||||
retcode = subprocess.getstatusoutput('service {0} status'
|
retcode = subprocess.getstatusoutput('service {0} status'
|
||||||
.format(service_name))
|
.format(service_name))
|
||||||
|
|||||||
Reference in New Issue
Block a user