Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #43009 : headers_sent() is PHP responsibility not Apache! do your job please
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 12th August 06:23
php-bugs
External User
 
Posts: 1
Default #43009 : headers_sent() is PHP responsibility not Apache! do your job please



From: hamdi at rawasy dot com
Operating system: Irrelevant
PHP version: 4.4.7
PHP Bug Type: Feature/Change Request
Bug description: headers_sent() is PHP responsibility not Apache! do your job please

Description:
------------
Referring to my previous report that holds ID 42992
http://bugs.php.net/bug.php?id=42992

Yes, PHP is not responsible about virtual() behavior.
But I think that it's holding the full responsibility against
headers_sent() behavior and I'm asking to fix headers_sent() not virtual(),
as it says that headers was already sent while it wasn't, you could send
any headers after that and no problems happens (there is no buffer
controllers). So, is it still apache problem?

Also the filename & line number returned by headers_sent() indicates that
headers wasn't sent! and that is stupid behavior

Summary
You should return true from headers_sent() only when filename & line
number are set, otherwise return false.

I repeat, this bug is PHP problem located at headers_sent() function! Not
anything else.

I think that your job here is to fix those bugs not throwing blame at
others. So, do your job please!

Reproduce code:
---------------
<?php
virtual("empty.php"); // An empty file
var_dump(headers_sent($file, $line), $file, $line);
?>

Expected result:
----------------
bool(false)
string(0) ""
int(0)

Actual result:
--------------
bool(true)
string(0) ""
int(0)

--
Edit bug report at http://bugs.php.net/?id=43009&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43009&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43009&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43009&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43009&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43009&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43009&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43009&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43009&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43009&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43009&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43009&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43009&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43009&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43009&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43009&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43009&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43009&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43009&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43009&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43009&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43009&r=mysqlcfg
  Reply With Quote


  sponsored links


2 17th August 20:38
php-bugs
External User
 
Posts: 1
Default #43009 : headers_sent() is PHP responsibility not Apache! do your job please



ID: 43009
Comment by: codeslinger at compsalot dot com
Reported By: hamdi at rawasy dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 4.4.7
New Comment:

I suspect your problem is not a bug at all, but is the result of not
deciphering an error message that is somewhat mis-leading.

What the error message says is "headers have already been sent". What
you appears to be complaining about is that you have not in fact sent
any headers.


What you probably don't realize is that any text at all which is seen
to be part of the web page, is considered to create a situation of
"headers already sent".

The issue is not actually that the headers have been sent, the issue is
that the headers MUST proceed any and all text.

The usual cause of this situation is when the php tag is not the actual
start of the do***ent. if there is even a single space character in
front of the tag it will cause this problem. Also any blank lines after
the end of the closing php tag can cause this problem. And be sure to
check all of your include files. Blank lines at the end of include
files drive me totally nuts until I figured out what was going on.

Any character at all, including blank lines, which is outside of the
php code brackets is considered to be part of the web page itself.

In order to use php to send headers, you CAN'T send any other character
at all to the web page.

The work-around, for sloppy editing/coding is to turn on output
buffering, see the manual. With output buffering enabled, php holds
anything being sent, and it is able to insert headers in front of
already sent text. But this is really the wrong solution, the right
solution is to fix your code.

The requirement that headers MUST be sent first is defined by the HTTP
protocol itself and can not be changed.


Previous Comments:
------------------------------------------------------------------------

[2007-10-17 17:41:35] hamdi at rawasy dot com

Description:
------------
Referring to my previous report that holds ID 42992
http://bugs.php.net/bug.php?id=42992

Yes, PHP is not responsible about virtual() behavior.
But I think that it's holding the full responsibility against
headers_sent() behavior and I'm asking to fix headers_sent() not
virtual(), as it says that headers was already sent while it wasn't, you
could send any headers after that and no problems happens (there is no
buffer controllers). So, is it still apache problem?

Also the filename & line number returned by headers_sent() indicates
that headers wasn't sent! and that is stupid behavior

Summary
You should return true from headers_sent() only when filename & line
number are set, otherwise return false.

I repeat, this bug is PHP problem located at headers_sent() function!
Not anything else.

I think that your job here is to fix those bugs not throwing blame at
others. So, do your job please!

Reproduce code:
---------------
<?php
virtual("empty.php"); // An empty file
var_dump(headers_sent($file, $line), $file, $line);
?>

Expected result:
----------------
bool(false)
string(0) ""
int(0)

Actual result:
--------------
bool(true)
string(0) ""
int(0)


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=43009&edit=1
  Reply With Quote
3 17th August 20:38
php-bugs
External User
 
Posts: 1
Default #43009 : headers_sent() is PHP responsibility not Apache! do your job please


ID: 43009
Comment by: codeslinger at compsalot dot com
Reported By: hamdi at rawasy dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 4.4.7
New Comment:

apologies for the poor grammar, I should have proof-read more carefully
before hitting submit.


Previous Comments:
------------------------------------------------------------------------

[2007-12-19 21:08:31] codeslinger at compsalot dot com

I suspect your problem is not a bug at all, but is the result of not
deciphering an error message that is somewhat mis-leading.

What the error message says is "headers have already been sent". What
you appears to be complaining about is that you have not in fact sent
any headers.


What you probably don't realize is that any text at all which is seen
to be part of the web page, is considered to create a situation of
"headers already sent".

The issue is not actually that the headers have been sent, the issue is
that the headers MUST proceed any and all text.

The usual cause of this situation is when the php tag is not the actual
start of the do***ent. if there is even a single space character in
front of the tag it will cause this problem. Also any blank lines after
the end of the closing php tag can cause this problem. And be sure to
check all of your include files. Blank lines at the end of include
files drive me totally nuts until I figured out what was going on.

Any character at all, including blank lines, which is outside of the
php code brackets is considered to be part of the web page itself.

In order to use php to send headers, you CAN'T send any other character
at all to the web page.

The work-around, for sloppy editing/coding is to turn on output
buffering, see the manual. With output buffering enabled, php holds
anything being sent, and it is able to insert headers in front of
already sent text. But this is really the wrong solution, the right
solution is to fix your code.

The requirement that headers MUST be sent first is defined by the HTTP
protocol itself and can not be changed.

------------------------------------------------------------------------

[2007-10-17 17:41:35] hamdi at rawasy dot com

Description:
------------
Referring to my previous report that holds ID 42992
http://bugs.php.net/bug.php?id=42992

Yes, PHP is not responsible about virtual() behavior.
But I think that it's holding the full responsibility against
headers_sent() behavior and I'm asking to fix headers_sent() not
virtual(), as it says that headers was already sent while it wasn't, you
could send any headers after that and no problems happens (there is no
buffer controllers). So, is it still apache problem?

Also the filename & line number returned by headers_sent() indicates
that headers wasn't sent! and that is stupid behavior

Summary
You should return true from headers_sent() only when filename & line
number are set, otherwise return false.

I repeat, this bug is PHP problem located at headers_sent() function!
Not anything else.

I think that your job here is to fix those bugs not throwing blame at
others. So, do your job please!

Reproduce code:
---------------
<?php
virtual("empty.php"); // An empty file
var_dump(headers_sent($file, $line), $file, $line);
?>

Expected result:
----------------
bool(false)
string(0) ""
int(0)

Actual result:
--------------
bool(true)
string(0) ""
int(0)


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=43009&edit=1
  Reply With Quote
4 24th August 10:39
php-bugs
External User
 
Posts: 1
Default #43009 : headers_sent() is PHP responsibility not Apache! do your job please


ID: 43009
Comment by: codeslinger at compsalot dot com
Reported By: hamdi at rawasy dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 4.4.7
New Comment:

I just now got around to reading the docs on "virtual" which your
example program is using.

This bug is totally bogus. The docs make it very clear what the
behavior of "virtual" is. This behavior is by design.

My previous comments about probable causes of "headers already sent"
are valid, they just don't apply to your program example.


Previous Comments:
------------------------------------------------------------------------

[2007-12-19 21:18:07] codeslinger at compsalot dot com

apologies for the poor grammar, I should have proof-read more carefully
before hitting submit.

------------------------------------------------------------------------

[2007-12-19 21:08:31] codeslinger at compsalot dot com

I suspect your problem is not a bug at all, but is the result of not
deciphering an error message that is somewhat mis-leading.

What the error message says is "headers have already been sent". What
you appears to be complaining about is that you have not in fact sent
any headers.


What you probably don't realize is that any text at all which is seen
to be part of the web page, is considered to create a situation of
"headers already sent".

The issue is not actually that the headers have been sent, the issue is
that the headers MUST proceed any and all text.

The usual cause of this situation is when the php tag is not the actual
start of the do***ent. if there is even a single space character in
front of the tag it will cause this problem. Also any blank lines after
the end of the closing php tag can cause this problem. And be sure to
check all of your include files. Blank lines at the end of include
files drive me totally nuts until I figured out what was going on.

Any character at all, including blank lines, which is outside of the
php code brackets is considered to be part of the web page itself.

In order to use php to send headers, you CAN'T send any other character
at all to the web page.

The work-around, for sloppy editing/coding is to turn on output
buffering, see the manual. With output buffering enabled, php holds
anything being sent, and it is able to insert headers in front of
already sent text. But this is really the wrong solution, the right
solution is to fix your code.

The requirement that headers MUST be sent first is defined by the HTTP
protocol itself and can not be changed.

------------------------------------------------------------------------

[2007-10-17 17:41:35] hamdi at rawasy dot com

Description:
------------
Referring to my previous report that holds ID 42992
http://bugs.php.net/bug.php?id=42992

Yes, PHP is not responsible about virtual() behavior.
But I think that it's holding the full responsibility against
headers_sent() behavior and I'm asking to fix headers_sent() not
virtual(), as it says that headers was already sent while it wasn't, you
could send any headers after that and no problems happens (there is no
buffer controllers). So, is it still apache problem?

Also the filename & line number returned by headers_sent() indicates
that headers wasn't sent! and that is stupid behavior

Summary
You should return true from headers_sent() only when filename & line
number are set, otherwise return false.

I repeat, this bug is PHP problem located at headers_sent() function!
Not anything else.

I think that your job here is to fix those bugs not throwing blame at
others. So, do your job please!

Reproduce code:
---------------
<?php
virtual("empty.php"); // An empty file
var_dump(headers_sent($file, $line), $file, $line);
?>

Expected result:
----------------
bool(false)
string(0) ""
int(0)

Actual result:
--------------
bool(true)
string(0) ""
int(0)


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=43009&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666