php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23949 exec() interferes with header()
Submitted: 2003-06-02 04:53 UTC Modified: 2003-06-02 05:06 UTC
From: drigolin at iol dot it Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.1 OS: Windows 2000 Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: drigolin at iol dot it
New email:
PHP Version: OS:

 

 [2003-06-02 04:53 UTC] drigolin at iol dot it
Using this code: 

<?php
exec("online.bat param1");
header("Location:http://myserver/mypage.php");
exit;
?>

my browsers (IE and Mozilla) instead of do a redirect they display this message:

Status: 302
Content-type: text/html
X-Powered-By: PHP/4.3.1
Location:http://myserver/mypage.php

That is the full "dump" of the HTTP header of a Redirect (302) but it seems that exec() put into output stream any char that causes browsers to misunderstand the header and consider it an "raw text output".

Commenting exec or calling other function makes the script working correctly and the browser works ok.

Best regards.

P.S.: PHP is working as CGI on Netscape iPlanet Web Server.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-02 05:06 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

4.3.2 was release already.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC