From 39664d42d09ebcde06b20b3a25819878c25ee109 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sat, 17 Jun 2017 19:27:16 +0200 Subject: [PATCH] Fix binary when running via phpdbg --- lib/Process/ChannelledProcess.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Process/ChannelledProcess.php b/lib/Process/ChannelledProcess.php index a6fb1b6e..bdbe1977 100644 --- a/lib/Process/ChannelledProcess.php +++ b/lib/Process/ChannelledProcess.php @@ -28,7 +28,8 @@ class ChannelledProcess implements ProcessContext, Strand { * @param mixed[] $env Array of environment variables. */ public function __construct(string $path, string $cwd = "", array $env = []) { - $command = \PHP_BINARY . " " . \escapeshellarg($path); + $binary = \PHP_SAPI === "phpdbg" ? \PHP_BINARY . " -qrr --" : \PHP_BINARY; + $command = $binary . " " . \escapeshellarg($path); $this->process = new Process($command, $cwd, $env); }