From 577bcc1f92252a795f9871e183b0caef975c9635 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 21 Jul 2017 08:32:23 +0200 Subject: [PATCH] Use BlockingDriver in SAPIs like Apache or FPM --- lib/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/functions.php b/lib/functions.php index a82b9af..a753c1e 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -51,6 +51,10 @@ function driver(): Driver { return new BlockingDriver; } + if (\PHP_SAPI !== "cli" && \PHP_SAPI !== "phpdbg") { // We don't have a binary to launch sub-processes + return new BlockingDriver; + } + if (\defined("AMP_WORKER")) { // Prevent spawning infinite workers. return new BlockingDriver; }