Skip to content

Commit 787df82

Browse files
author
mikefero
committed
Fixing startup of the PHP standalone webserver on Windows
1 parent 9ad0a81 commit 787df82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ private function execute(array $env = array())
304304
private function startWebServer()
305305
{
306306
$this->webServerURL = 'http://127.0.0.1:10000';
307-
$command = sprintf('exec %s -S "%s"', $this->phpBin, '127.0.0.1:10000');
307+
$command = sprintf('%s -S "%s"', $this->phpBin, '127.0.0.1:10000');
308+
if (!strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
309+
$command = 'exec' . $command;
310+
}
308311
if ($this->phpBinOptions) {
309312
$command = sprintf("%s %s", $command, $this->phpBinOptions);
310313
}

0 commit comments

Comments
 (0)