diff --git a/src/Symfony/Component/Process/PhpProcess.php b/src/Symfony/Component/Process/PhpProcess.php index 34078e0aa659..628b3f3f402b 100644 --- a/src/Symfony/Component/Process/PhpProcess.php +++ b/src/Symfony/Component/Process/PhpProcess.php @@ -78,8 +78,8 @@ public function run($callback = null) */ private function getPhpBinary() { - if (getenv('PHP_PATH')) { - if (!is_executable($php = getenv('PHP_PATH'))) { + if ($php = getenv('PHP_PATH')) { + if (!is_executable($php)) { throw new \RuntimeException('The defined PHP_PATH environment variable is not a valid PHP executable.'); } @@ -93,6 +93,12 @@ private function getPhpBinary() } } + if ($php = getenv('PHP_PEAR_PHP_BIN')) { + if (is_executable($php)) { + return $php; + } + } + throw new \RuntimeException('Unable to find the PHP executable.'); } }