Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Process] Windows REG utility not recognized as an internal or external command #44260

Copy link
Copy link
Closed
@stable-staple

Description

@stable-staple
Issue body actions

Symfony version(s) affected

4.4

Description

The Symphony component "Process" doesn't recognize the environment variable "Path", which leads to the fact that it's impossible to perform operations with the standard Windows utilities and other programs written in the "Path" variable.

How to reproduce

Windows-only: run script from a web server with the following code:

    $registry_path = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows";
    $pathname = "C:\\example.reg";
    $command = 'reg save ' . '"' . $registry_path . '" "' . $pathname . '"';
    
    $process = Process::fromShellCommandline($command);
    $code = $process->run();

    if (!$process->isSuccessful()) {
        echo 'fail';
    }

Possible Solution

Windows environment variables should be treated case-insensitively. Intersection of $_SERVER with getenv() is performed to get the default envs, but intersection in question is done in a case-sensitive manner, which leads to bugs in Windows.

Additional Context

Bug doesn't reproduce in a command line environment.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.