From 3fb1cf24c359dfca9e8f36bb1e092b93ad265f15 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 12 Oct 2021 13:33:16 +0200 Subject: [PATCH] Fix #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php --- run-tests.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index ce86e068dc4..fa18046dbfb 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1057,11 +1057,14 @@ function get_binary(string $php, string $sapi, string $sapi_path): ?string if (IS_WINDOWS && file_exists("$dir/$sapi.exe")) { return realpath("$dir/$sapi.exe"); } + // Sources tree if (file_exists("$dir/../../$sapi_path")) { return realpath("$dir/../../$sapi_path"); } - if (file_exists("$dir/$sapi")) { - return realpath("$dir/$sapi"); + // Installation tre, preserve command prefix/suffix + $inst = str_replace('php', $sapi, basename($php)); + if (file_exists("$dir/$inst")) { + return realpath("$dir/$inst"); } return null; }