[php-src] Issue #20792: Running `run-tests.php` with a PHP executable in a path having whitespace results in an error
| From: | sharadraju | Date: | Sun, 28 Dec 2025 04:32:26 +0000 |
| Subject: | [php-src] Issue #20792: Running `run-tests.php` with a PHP executable in a path having whitespace results in an error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251440@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20792
Author: sharadraju
### Description
My PHP executable is in "C:\Program Files". When I ran
php run-tests.php,
this gives an error.
```
'C:\Program' is not recognized as an internal or external command
```
The reason is that the run_test() function uses $orig_php variable without being
escaped
Platforms : Windows 11
PHP version: 8.3
The fix is quite simple.
we have to move $orig_php=$php after the line $php = escapeshellarg($php); in
run_test() function
### PHP Version
```plain
> PHP -v
PHP 8.3.9 (cli) (built: Jul 2 2024 18:18:06) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies
```
### Operating System
Windows 11