|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40429 headers sent when using php://output + ob_start
Submitted: 2007-02-10 12:34 UTC Modified: 2007-03-21 14:17 UTC
From: nicolas dot grekas+php at gmail dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.1.2 OS: WIN
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.
Block user comment
Status: Assign to:
Bug Type:
From: nicolas dot grekas+php at gmail dot com
New email:
PHP Version: OS:


 [2007-02-10 12:34 UTC] nicolas dot grekas+php at gmail dot com
Opening the php://output stream seams to flag the headers as sent, event if output buffering is on. Consequently, any call to header() fails where it shouldn't.

Affects any extension that uses streams.

Reproduce code:

$h = fopen('php://output', 'wb');

header('X-Foo: bar');




$dom = new DOMDocument;

header('X-Foo: bar');


Expected result:
blank page

Actual result:
Warning: Cannot modify header information - headers already sent in C:\[...]\test.php on line 8


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 09:37 UTC]
Cannot reproduce with any of your examples.
Makes sure you're actually using 5.2.1 and not something old.
 [2007-02-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-03-21 14:17 UTC] nicolas dot grekas+php at gmail dot com
Sorry, I was experimenting the bug in PHP 5.1.2, not 5.2.1...
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 11:01:32 2024 UTC