From a628505cd99b201375dd6bcd0b062ee07c8ba556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=A4rtl?= Date: Thu, 26 Jan 2017 09:29:31 +0100 Subject: [PATCH] Issue #20 Read stderr before stdout to avoid hanging processes --- src/Command.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command.php b/src/Command.php index 0e09bc5..5432c5a 100644 --- a/src/Command.php +++ b/src/Command.php @@ -315,8 +315,9 @@ public function execute() if (is_resource($process)) { - $this->_stdOut = stream_get_contents($pipes[1]); + // Issue #20: Read stderr before stdout to avoid hanging processes $this->_stdErr = stream_get_contents($pipes[2]); + $this->_stdOut = stream_get_contents($pipes[1]); fclose($pipes[1]); fclose($pipes[2]);