|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18994 exec() with redirection pipes fails.
Submitted: 2002-08-20 16:37 UTC Modified: 2002-10-14 19:35 UTC
From: christian at riiser dot se Assigned:
Status: No Feedback Package: IIS related
PHP Version: 4.2.2 OS: Windows 2000 SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
35 + 2 = ?
Subscribe to this entry?

 [2002-08-20 16:37 UTC] christian at riiser dot se

exec("cmd.exe /c dir",$result,$status)
gives good output to result array.


exec("cmd.exe /c dir>c:\TEMP\test.txt",$result,$status)

fails with access error.

User running website has full access to C:\temp.
----------"------------- read access to cmd.exe.

Loggin on to machine with same user account and opening an cmd windows & running the full cmd.exe /c etc.etc. works...

It looks like an bug, but I might be very wrong. If so, please to hesitate to tell me that... :)



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-26 11:18 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

exec("cmd.exe /c dir > c:\\TEMP\\test.txt",$result,$status)

(Quote your backslashes!)

If that doesn't solve the problem, we need more info
like the actual error message and your ini settings etc. etc.
 [2002-10-14 19:35 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 05:03:45 2023 UTC