From c8109b11b1f8cda5ea8286c9c54a0653e3559993 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Fri, 28 Aug 2020 16:21:44 +0900 Subject: [PATCH] Sleep 1 sec till server start (PHP 7.4 <) --- src/Http/BuiltinServer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Http/BuiltinServer.php b/src/Http/BuiltinServer.php index d722872..25228b8 100644 --- a/src/Http/BuiltinServer.php +++ b/src/Http/BuiltinServer.php @@ -40,6 +40,11 @@ public function __construct(string $host, string $index) public function start() : void { $this->process->start(); + if (version_compare(PHP_VERSION, '7.4.0', '<')) { + sleep(1); + + return; + } $this->process->waitUntil(function (string $type, string $output) : bool { if ($type === 'err' && ! is_int(strpos($output, 'started'))) { error_log($output);