Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52ed988

Browse files
committed
Add relative path support for PHP_BINARY env var of PhpExecutableFinder
1 parent da0ef24 commit 52ed988

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ public function find($includeArgs = true)
3737
{
3838
if ($php = getenv('PHP_BINARY')) {
3939
if (!is_executable($php)) {
40-
return false;
40+
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
41+
if ($php = strtok(exec($command.' '.escapeshellarg($php)), PHP_EOL)) {
42+
if (!is_executable($php)) {
43+
return false;
44+
}
45+
} else {
46+
return false;
47+
}
4148
}
4249

4350
return $php;

0 commit comments

Comments
 (0)