diff --git a/src/Watcher.php b/src/Watcher.php index b62fd03..c94a15c 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -125,13 +125,18 @@ public function restart($isStart = true) $this->channel->pop(); $this->output->writeln('Start server ...'); - $descriptorspec = [ + $descriptorSpec = [ 0 => STDIN, 1 => STDOUT, 2 => STDERR, ]; - proc_open($this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(), $descriptorspec, $pipes); + proc_open( + $this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(), + $descriptorSpec, + $pipes, + env_vars: $_ENV + ); $this->output->writeln('Stop server success.'); $this->channel->push(1);