Skip to content

Running run-tests.php with a PHP executable in a path having whitespace results in an error #20792

@sharadraju

Description

@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

> 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions