From 0fe82bd0c9fdce78f6bd37463075cb45a99b25a4 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 18 Mar 2010 11:08:27 -0700 Subject: Runtime check for known bad PHP versions with 64-bit stream_select() bug in xmppdaemon.php. --- scripts/xmppdaemon.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 26c7991b8..abd7cc22b 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -98,7 +98,15 @@ class XmppMaster extends IoMaster // don't have to find an XMPP site to start up when using --all mode. if (common_config('xmpp','enabled')==false) { print "Aborting daemon - xmpp is disabled\n"; - exit(); + exit(1); +} + +if (version_compare(PHP_VERSION, '5.2.6', '<')) { + $arch = php_uname('m'); + if ($arch == 'x86_64' || $arch == 'amd64') { + print "Aborting daemon - 64-bit PHP prior to 5.2.6 has known bugs in stream_select; you are running " . PHP_VERSION . " on $arch.\n"; + exit(1); + } } if (have_option('i', 'id')) { -- cgit v1.2.3-54-g00ecf