diff --git a/src/Symfony/Component/Process/PhpExecutableFinder.php b/src/Symfony/Component/Process/PhpExecutableFinder.php index fb297825fe364..26fb691286fce 100644 --- a/src/Symfony/Component/Process/PhpExecutableFinder.php +++ b/src/Symfony/Component/Process/PhpExecutableFinder.php @@ -62,11 +62,19 @@ public function find($includeArgs = true) } } - $dirs = array(PHP_BINDIR); + $dirs = array(); if ('\\' === DIRECTORY_SEPARATOR) { $dirs[] = 'C:\xampp\php\\'; } + $name = 'php'; + foreach (array('', '.exe', '.bat', '.cmd', '.com') as $suffix) { + if (@is_file($file = PHP_BINDIR.DIRECTORY_SEPARATOR.$name.$suffix) && + ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) { + return $file; + } + } + return $this->executableFinder->find('php', false, $dirs); }