Skip to content

Commit de337c7

Browse files
committed
Fix for Bug: Failed to find the PHP version for c:/Program Files/php-8.2.18-Win32-vs16-x64 #11
The underlying cmd command to find the php.exe file and echo it's version fails if there is a space in the path, like `c:/Program Files/php-8.2.18-Win32-vs16-x64`. Fixes #11 by surrounding the path in quotes.
1 parent c18d1bf commit de337c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/Valet/PhpCgi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function findPhpVersion($phpPath) {
215215
return null;
216216
}
217217

218-
$phpVersion = $this->cli->runOrExit("{$phpExecPath} -r \"echo PHP_VERSION;\"",
218+
$phpVersion = $this->cli->runOrExit("\"$phpExecPath\" -r \"echo PHP_VERSION;\"",
219219
function ($code, $output) use ($phpPath) {
220220
error("Failed to find the PHP version for {$phpPath}");
221221
}

0 commit comments

Comments
 (0)