From 17567ed8af9885e8c3e00d7b61852a70b865dc05 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Tue, 12 Dec 2023 05:55:31 -0700 Subject: [PATCH] Add log entry if pcntl_fork is disabled in php.ini. --- Rocksolid_Light/rslight/scripts/cron.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Rocksolid_Light/rslight/scripts/cron.php b/Rocksolid_Light/rslight/scripts/cron.php index 8edb7c3..ad80474 100644 --- a/Rocksolid_Light/rslight/scripts/cron.php +++ b/Rocksolid_Light/rslight/scripts/cron.php @@ -40,9 +40,17 @@ if (isset($CONFIG['enable_nntp']) && $CONFIG['enable_nntp'] == true) { } } } - exec($CONFIG['php_exec'] . " " . $config_dir . "/scripts/nntp.php > /dev/null 2>&1"); - if (is_numeric($CONFIG['local_ssl_port'])) { - exec($CONFIG['php_exec'] . " " . $config_dir . "/scripts/nntp-ssl.php > /dev/null 2>&1"); + + $disabled_php = ini_get('disable_functions'); + echo $disabled_php; + if(strpos($disabled_php, 'pcntl_fork') !== false) { + echo "\nERROR: pcntl_fork() disabled in php ini file, cannot fork (nntp server will not start)."; + file_put_contents($logfile, "\n" . format_log_date() . " ERROR: pcntl_fork() disabled in php ini file, cannot fork (nntp server will not start).", FILE_APPEND); + } else { + exec($CONFIG['php_exec'] . " " . $config_dir . "/scripts/nntp.php > /dev/null 2>&1"); + if (is_numeric($CONFIG['local_ssl_port'])) { + exec($CONFIG['php_exec'] . " " . $config_dir . "/scripts/nntp-ssl.php > /dev/null 2>&1"); + } } } # Generate user count file (must be root)