php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25039 system function cause header error / IIS6.0
Submitted: 2003-08-11 07:49 UTC Modified: 2003-08-11 11:51 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: sadun at isikun dot org Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.3RC3 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2003-08-11 07:49 UTC] sadun at isikun dot org
Description:
------------
on iis6.0 when i call NET.exe with system or exec function get faced with an error and if it's some comlex command it gives "CGI returned bad header" error.

Reproduce code:
---------------
<pre>
<?

echo exec("NET");

?>

Expected result:
----------------
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
      HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
      SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]



Actual result:
--------------
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
      HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
      SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]

Content-type: text/html
X-Powered-By: PHP/4.3.3RC2
Set-Cookie: PHPSESSID=ebfd9b5ea0d4316aa9a32b3e1dec41b5; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

<pre>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-11 08:59 UTC] iliaa@php.net
Are you using php as CGI or ISAPI?
 [2003-08-11 11:14 UTC] sadun at isikun dot org
to get CGI error shouldn't i use CGI version..

yes i use CGI version

actually i get this kind of error often
 [2003-08-11 11:25 UTC] edink@php.net
First lookup documentation for exec(). It only returns the last line of the output so your expectation is wrong.

Second, NET outputs to stderr not stdout which php captures. You can try exec("net 2>&1"); to prevent this.

 [2003-08-11 11:51 UTC] sadun at isikun dot org
ok i solve my problem with using MS vb script. but in my opinion PHP is for standart users. it's aim is to get reach basic users "Personal Home Page" don't get away from this point of view. according to that how a basic knowleged user can know about "NET outputs to stderr not stdout which php captures" ? at manual ist says that 
--------------------------------------
exec
(PHP 3, PHP 4 )

exec -- Execute an external program
--------------------------------------

so inconculusion 
after that exec should capture stderr also. do you think am'i wrong ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC