Skip to content

Commit

Permalink
BUGFIX: Catch stderr output, in case phpPathAndBinary is not found
Browse files Browse the repository at this point in the history
previously on windows:

```
.\flow.bat configuration:show
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.

  Type: Neos\Flow\Core\Booting\Exception\SubProcessException
  Code: 1355480641
  File: Packages\Framework\Neos.Flow\Classes\Core\Booting\Scripts.php
  Line: 716

Open Data/Logs/Exceptions/20230715100927f65665.txt for a full stack trace.
```

notice the duplicated echo'd `Das System kann den angegebenen Pfad nicht finden.`

afterwards, the first echo will be gone.
  • Loading branch information
mhsdesign committed Jul 18, 2023
1 parent 32bfb00 commit 9d106b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Neos.Flow/Classes/Core/Booting/Scripts.php
Expand Up @@ -835,7 +835,7 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB
}

// Try to resolve which binary file PHP is pointing to
exec($phpBinaryPathAndFilename . ' -r "echo realpath(PHP_BINARY);"', $output, $result);
exec($phpBinaryPathAndFilename . ' -r "echo realpath(PHP_BINARY);" 2>&1', $output, $result);
if ($result === 0 && sizeof($output) === 1) {
// Resolve any wrapper
$configuredPhpBinaryPathAndFilename = $output[0];
Expand Down Expand Up @@ -879,7 +879,7 @@ protected static function ensureWebSubrequestsUseCurrentlyRunningPhpVersion($php
return;
}

exec($phpCommand . ' -r "echo PHP_VERSION;"', $output, $result);
exec($phpCommand . ' -r "echo PHP_VERSION;" 2>&1', $output, $result);

if ($result !== 0) {
return;
Expand Down

0 comments on commit 9d106b1

Please sign in to comment.