php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53424 passthru() and STDERR
Submitted: 2010-11-29 21:26 UTC Modified: 2010-12-04 17:04 UTC
From: myselfasunder at gmail dot com Assigned:
Status: Not a bug Package: Program Execution
PHP Version: 5.2.14 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: myselfasunder at gmail dot com
New email:
PHP Version: OS:

 

 [2010-11-29 21:26 UTC] myselfasunder at gmail dot com
Description:
------------
Please also display STDERR output. This is a request specific for Windows. Obviously this isn't a problem under Linux.

Test script:
---------------
passthru('<command that only outputs STDERR>');


Expected result:
----------------
I expect everything from STDOUT and STDERR to be displayed.

Actual result:
--------------
Will output nothing (expect maybe a little whitespace).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-30 06:28 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2010-11-30 06:28 UTC] dtajchreber@php.net
passthru("$cmd 2>&1");
 [2010-11-30 07:29 UTC] myselfasunder at gmail dot com
Please re-read the original ticket:

"Please also display STDERR output. This is a request specific for Windows. Obviously this isn't a problem under Linux."

You've provided the well-known Unix/Linux solution. This solution is not supported under Windows.

Please re-open the ticket, even if you can't provide a solution at this time. This will save me the effort of opening another one.


Dustin
 [2010-11-30 09:02 UTC] jani@php.net
-Status: Bogus +Status: Open -Type: Bug +Type: Feature/Change Request
 [2010-11-30 09:05 UTC] jani@php.net
See bug #41874.
 [2010-11-30 09:05 UTC] jani@php.net
-Status: Open +Status: Bogus
 [2010-11-30 13:53 UTC] dtajchreber@php.net
Windows also supports redirection: 

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-
us/redirection.mspx?mfr=true
 [2010-12-04 16:39 UTC] myselfasunder at gmail dot com
This solution does not work for Windows. Although adding the "2>&1" on to the end of the command doesn't induce an error, it still DOES NOT redirect STDERR. Try it.

Please just add the functionality.
 [2010-12-04 16:44 UTC] myselfasunder at gmail dot com
..Also: This issue is occurring within the context of trying to implement FFMPEG (which outputs everything in STDER because of how it can be used for pipes). Even if Windows has some support for redirection, it's not complete enough to work for FFMPEG. Redirection has no effect.

Therefore, this passthru() needs to compensate in order to be functional for STDERR.
 [2010-12-04 17:04 UTC] pajoye@php.net
it does, use:

somecmd.bat > log 2<&1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC