diff --git a/ManiaControl.php b/ManiaControl.php index 25a659be..65b79761 100644 --- a/ManiaControl.php +++ b/ManiaControl.php @@ -29,7 +29,9 @@ if (!ini_get('date.timezone') && function_exists('date_default_timezone_set')) { gc_enable(); // Listen process signals -pcntl_async_signals(true); +if (extension_loaded('pcntl')) { + pcntl_async_signals(true); +} // Register AutoLoader require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php'; diff --git a/core/ManiaControl.php b/core/ManiaControl.php index 944c6488..273b3e4f 100644 --- a/core/ManiaControl.php +++ b/core/ManiaControl.php @@ -653,9 +653,11 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener, try { // Manage SIGTERM signal - pcntl_signal(SIGTERM, function() { - $this->quit("Stop signal received from the OS.", false); - }); + if (extension_loaded('pcntl')) { + pcntl_signal(SIGTERM, function() { + $this->quit("Stop signal received from the OS.", false); + }); + } // Connect to server $this->connect();