Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2474

Re: header() not being honored?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: header() not being honored?
Date 2011-07-08 14:11 -0400
Organization A noiseless patient Spider
Message-ID <iv7h85$6qf$1@dont-email.me> (permalink)
References <iv6v01$qou$1@speranza.aioe.org>

Show all headers | View raw


On 7/8/2011 8:57 AM, Billy Mays wrote:
> I am trying to have php output previously gzipped data, but it seems
> like php is ignoring the call altogether.
>
> Code:
>
> #######################################
> /* Trying to prevent the chunked encoding */
> header('Content-Length: ' . filesize($file) );
> header('Content-Encoding: gzip');
>
> readfile($file);
>
> echo "anything";
>
> die();
> ########################################
>
> It seems that the first call header get completely ignored (I watched
> the headers with telnet) and after the readfile() call the the echo is
> never used.
>
> Am I misunderstanding how to use the header function? Is there another
> way to see whats going on? Unfortunately, I'm in a shared hosting
> environment, PHP: 4.4.9
>
> --
> Bill

I don't think you can prevent chunking in HTTP 1.1.  You would have to 
send as HTTP 1.0, which would require a configuration change in the web 
server.

And I would suggest you change your hosting immediately.  PHP 4.x has 
been out of service for years, and if your hosting company is still 
running it, I would be afraid of what other old software they're running.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

header() not being honored? Billy Mays <noway@nohow.com> - 2011-07-08 08:57 -0400
  Re: header() not being honored? Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-08 14:11 -0400
  Re: header() not being honored? crankypuss <no@email.thanks> - 2011-07-09 04:25 -0600
  Re: header() not being honored? Andre <pas@pourmois.be> - 2011-07-09 13:03 +0000
    Re: header() not being honored? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-10 08:47 +0200
      Re: header() not being honored? Andre <pas@pourmois.be> - 2011-07-10 14:18 +0000

csiph-web