Re: Unable to use HTML_Compress::output() from PEAR destructor
| From: | Alan McFarlane | Date: | Sat, 26 Jan 2002 07:23:35 +0000 |
| Subject: | Re: Unable to use HTML_Compress::output() from PEAR destructor | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-735@lists.php.net to get a copy of this message | ||
Obviously, something is generating output before you start the compression
routine.
Try a different method of generating your output i.e.:
<?php
// do some processing
$page = "... some content ... ";
// do some more processing
HTTP_Compress:start();
echo $page;
HTTP_Compress::output();
?>
Christian Heimes <heimes@faho.rwth-aachen.de> wrote in message
news:3C503C32.3030300@faho.rwth-aachen.de...
> I want to print the compress output with HTML_Compress::output() from a
> PEAR destructor and everytime I get the following error messsage:
>
> ---
> Warning: Cannot add header information - headers already sent by (output
> started at A:101) in /usr/share/php/HTTP/Compress.php on line 86
>
> Warning: Cannot add header information - headers already sent by (output
> started at A:101) in /usr/share/php/HTTP/Compress.php on line 10
> ---
>
> "started at" is not correct. Sometimes it shows some ugly ASCII code and
> in most cases wrong line numbers.
> HTML_Compress::start() is called after $this->PEAR() and
> HTML_Compress::output() is called before $this->_PEAR()
>
> When I call the output() function somewhere else in the code, everything
> works fine.
>
> I'm using PHP 4.1.1 as Apache 1.3 module under linux.
>
> Christian
>