ID:               25890
 Comment by:       cysgwr_eryri at yahoo dot co dot uk
 Reported By:      cysgwr_eryri at yahoo dot dot dot co dot dot dot uk
 Status:           Bogus
 Bug Type:         HTTP related
 Operating System: Mandrake 9.1
 PHP Version:      4.3.3
 New Comment:

I can fully appreciate that, iliaa, and thank you for responding and
fully explaining the issue.

The reason I want to change those headers is to get around the
shortcomings of an archaic client.

I appreciate that, technically, it is not a bug in PHP itself. I've
written compiled modules for Apache, and I fully understand that the
API is complete and utter nightmare. However, in which case, surely
this *is* a bug in the sense that it pertains to a *documentation
omission* as opposed to an HTTP issue.

I couldn't find this information anywhere, and a short sentence in the
documentation pertaining to issues relating to the *most popular http
server on the planet*, and which headers can and cannot be changed,
would have gone a long way. Thank you again for your time and effort.


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

[2003-10-16 20:57:47] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Certain headers such as date & server cannot be manipulated due to
Apache's limitations on such changes, this has nothing to do with PHP.

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

[2003-10-16 12:13:21] cysgwr_eryri at yahoo dot dot dot co dot dot dot
uk

Description:
------------
Hello.

I'm not sure whether this is a bug or a configuration error, but it has
me stumped. I've searched the bugs and can't quite find anything
exactly the same. Ironically, a number of people have complained about
'Location: ' not working, but it works perfectly here, and that's not
what my problem is.

Operating system is Mandrake 9.1. Web Server is Apache 1.38 with php
4.3.3 (problem occurs whether either statically compiled-in or as
dynamic .so using apxs), with mod_perl 1.28 as a dynamic .so under apxs
(problem occurs whether this is loaded or not). Problem occurs whether
using php.ini-dist or a customised version. All ingredients compiled
from source.

I was trying to change some of the headers. The production code is
massive and unwieldy, but managed to display the same symptoms with
code reproduced below.

In short: On a normal request the server reponds as follows:

HTTP/1.1 200 OK
Date: Thu, 16 Oct 2003 15:44:22 GMT
Server: Apache/1.3.28 (Unix) mod_perl/1.28 PHP/4.3.3
X-Powered-By: PHP/4.3.3
Connection: close
Content-Type: text/html

However, trying to change *any* of the headers that are already present
fails. This fails whether you specify the boolean 'append' value or not
(if not, nothing is changed, if you specify 'appended', nothing is
added). Adding other headers works perfectly fine, but trying to change
those already present does not. 

Using the code provided the server returns this:

HTTP/1.1 200 OK
Date: Thu, 16 Oct 2003 16:07:54 GMT
Server: Apache/1.3.28 (Unix) mod_perl/1.28 PHP/4.3.3
X-Powered-By: PHP/4.3.3
Foo: Bar
Monkey: Nuts
Connection: close
Content-Type: text/html

The new headers are added perfectly correctly, but the old ones are not
altered at all. Is is just that these two headers are unalterable, is
this a bug, or could it be a configuration issue?


Reproduce code:
---------------
<?php
//change headers (older date, different server)
        header('Server: Monkey/1.0');
        header('Date: Mon, 18 Nov 2002 11:24:52 GMT');
//add other headers for testing...
        header("Foo: Bar");
        header("Monkey: Nuts");
?>



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


-- 
Edit this bug report at http://bugs.php.net/?id=25890&edit=1

Reply via email to