Add log entry if pcntl_fork is disabled in php.ini.

This commit is contained in:
Retro_Guy 2023-12-12 05:55:31 -07:00
parent c028cc653f
commit 17567ed8af
1 changed files with 11 additions and 3 deletions

View File

@ -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)