From c8392cf35deb9483d9fdf9698b9bad38fc1e0e74 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 28 Mar 2025 09:14:35 +0100 Subject: [PATCH 1/2] BUGFIX: #3442 ignore deprecations during web binary check --- Neos.Flow/Classes/Core/Booting/Scripts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Neos.Flow/Classes/Core/Booting/Scripts.php b/Neos.Flow/Classes/Core/Booting/Scripts.php index d8eb41b6cd..7698c4eca0 100644 --- a/Neos.Flow/Classes/Core/Booting/Scripts.php +++ b/Neos.Flow/Classes/Core/Booting/Scripts.php @@ -944,7 +944,8 @@ protected static function ensureWebSubrequestsUseCurrentlyRunningPhpVersion($php exec(join(' ', $command), $output, $result); - $phpInformation = json_decode($output[0] ?? '{}', true) ?: []; + $resultWithJson = end($output); // For multiple lines use the last line, to skip possible emitted deprecations + $phpInformation = $resultWithJson ? json_decode($resultWithJson, true) : false; if ($result !== 0 || ($phpInformation['sapi'] ?? null) !== 'cli') { throw new Exception\SubProcessException(sprintf('PHP binary might not exist or is not suitable for cli usage. Command `%s` didnt succeed.', $phpCommand), 1689676967447); From c7ede5e48c19635986636203c289bb7039f36d76 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 28 Mar 2025 09:17:57 +0100 Subject: [PATCH 2/2] BUGFIX: ignore deprecations during cli binary check --- Neos.Flow/Classes/Core/Booting/Scripts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.Flow/Classes/Core/Booting/Scripts.php b/Neos.Flow/Classes/Core/Booting/Scripts.php index 7698c4eca0..9e42e3f40d 100644 --- a/Neos.Flow/Classes/Core/Booting/Scripts.php +++ b/Neos.Flow/Classes/Core/Booting/Scripts.php @@ -874,9 +874,9 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB $output = []; exec(join(' ', $command), $output, $result); - if ($result === 0 && count($output) === 1) { + if ($result === 0 && $output !== []) { // Resolve any wrapper - $configuredPhpBinaryPathAndFilename = $output[0]; + $configuredPhpBinaryPathAndFilename = end($output); // Last entry, skip possible emitted deprecations } else { // Resolve any symlinks that the configured php might be pointing to $configuredPhpBinaryPathAndFilename = realpath($phpBinaryPathAndFilename); @@ -896,7 +896,7 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB // bypass with exec open_basedir restriction $output = []; exec(PHP_BINARY . ' -r "echo realpath(PHP_BINARY);"', $output); - $realPhpBinary = $output[0]; + $realPhpBinary = end($output); // Last entry, skip possible emitted deprecations } if (strcmp($realPhpBinary, $configuredPhpBinaryPathAndFilename) !== 0) { throw new Exception\SubProcessException(sprintf(