From d3558eb25fc0c4271a59364bd0fb5ccfa21b3c66 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 17 Aug 2011 12:54:52 -0700 Subject: [PATCH] Explicitly detect missing pcntl and exit with an obvious error Summary: We already detect this in setup but double-check just in case, see gmail thread. Test Plan: Rebuilt PHP without pcntl and tried to run phd, got an error. Reviewed By: aran Reviewers: aran, jungejason, tuomaspelkonen CC: aran Differential Revision: 819 --- scripts/daemon/phabricator_daemon_launcher.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/daemon/phabricator_daemon_launcher.php b/scripts/daemon/phabricator_daemon_launcher.php index ff6532bd61..4267a3a3c7 100755 --- a/scripts/daemon/phabricator_daemon_launcher.php +++ b/scripts/daemon/phabricator_daemon_launcher.php @@ -24,6 +24,17 @@ require_once $root.'/scripts/__init_env__.php'; phutil_require_module('phabricator', 'infrastructure/daemon/control'); $control = new PhabricatorDaemonControl(); +must_have_extension('pcntl'); +must_have_extension('posix'); + +function must_have_extension($ext) { + if (!extension_loaded($ext)) { + echo "ERROR: The PHP extension '{$ext}' is not installed. You must ". + "install it to run daemons on this machine.\n"; + exit(1); + } +} + switch (isset($argv[1]) ? $argv[1] : 'help') { case 'list': $err = $control->executeListCommand();