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

Missing backwards-incompatible change in PHP 8 #4054

Open
danielscsc opened this issue Nov 12, 2024 · 0 comments
Open

Missing backwards-incompatible change in PHP 8 #4054

danielscsc opened this issue Nov 12, 2024 · 0 comments
Labels
bug Documentation contains incorrect information Status: Verified

Comments

@danielscsc
Copy link

danielscsc commented Nov 12, 2024

From manual page: https://php.net/function.proc-open


In PHP 8.0, proc_open changed that it now runs (in Windows) cmd /s /c always.

See:
php/php-src@9ca449e

It is mentioned in the migration guide as well:
https://www.php.net/manual/en/migration80.incompatible.php#:~:text=now%20consistently%20execute-,%25comspec%25,-/s%20/c%20%22%24commandline

I think this should be noted in the proc_open page itself. I recently upgraded some servers from PHP 7.2 to 8.2, and this line of code, which used to work stopped working:

    $cmd = '"C:\\path\\to\\exe.exe '.$cssfile.'"';
    $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
    $process = proc_open($cmd, $descriptorspec, $pipes, $swffontdir);

The documentation for proc_open does mention changes regarding to escaping when using array as args, but not that the old string version also did.

Also, this is now misleading, as we pass /s /c:

Note: On Windows, unless bypass_shell is set to true in options, the command is passed to cmd.exe (actually, %ComSpec%) with the /c flag as unquoted string

@Girgias Girgias added bug Documentation contains incorrect information Status: Verified labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Documentation contains incorrect information Status: Verified
Projects
None yet
Development

No branches or pull requests

2 participants