diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index cf553ee11a6cf..a506e0c33e431 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -54,6 +54,10 @@ public function __construct($commandline, $cwd = null, array $env = null, $stdin $this->commandline = $commandline; $this->cwd = $cwd; + // on windows, if the cwd changed via chdir(), proc_open defaults to the dir where php was started + if (null === $this->cwd && defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->cwd = getcwd(); + } if (null !== $env) { $this->env = array(); foreach ($env as $key => $value) {