Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Make php binary setting check use realpath #2032

Merged
merged 2 commits into from Jul 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions Neos.Flow/Classes/Core/Booting/Scripts.php
Expand Up @@ -841,7 +841,7 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB
}

// Try to resolve which binary file PHP is pointing to
exec($phpBinaryPathAndFilename . ' -r "echo PHP_BINARY;"', $output, $result);
exec($phpBinaryPathAndFilename . ' -r "echo realpath(PHP_BINARY);"', $output, $result);
if ($result === 0 && sizeof($output) === 1) {
// Resolve any wrapper
$configuredPhpBinaryPathAndFilename = $output[0];
Expand All @@ -855,12 +855,13 @@ protected static function ensureCLISubrequestsUseCurrentlyRunningPhpBinary($phpB
return;
}

if (strcmp(PHP_BINARY, $configuredPhpBinaryPathAndFilename) !== 0) {
$realPhpBinary = realpath(PHP_BINARY);
if (strcmp($realPhpBinary, $configuredPhpBinaryPathAndFilename) !== 0) {
throw new FlowException(sprintf('You are running the Flow CLI with a PHP binary different from the one Flow is configured to use internally. ' .
'Flow has been run with "%s", while the PHP version Flow is configured to use for subrequests is "%s". Make sure to configure Flow to ' .
'use the same PHP binary by setting the "Neos.Flow.core.phpBinaryPathAndFilename" configuration option to "%s". Flush the ' .
'caches by removing the folder Data/Temporary before running ./flow again.',
PHP_BINARY, $configuredPhpBinaryPathAndFilename, PHP_BINARY), 1536303119);
$realPhpBinary, $configuredPhpBinaryPathAndFilename, $realPhpBinary), 1536303119);
}
}

Expand Down