It's quite simple, really. HTTP headers must be sent before any real
data, so sending data makes further sending of headers impossible. In
PHP files, anything not inside '<?php ... ?>' tags is output directly
to the browser.

The issue is not *really* limited to whitespace, it's just that
anything other than whitespace is really easy to see that it should /
shouldn't be there.

As for PHP4/5 differences, I'm not aware of any built-in handling for
this (although it might be possible). I think it's more likely that
your PHP5 dev server is using automatic output buffering; possibly for
ob_gz_handler. This caches all of the 'real' data, compresses it, and
sends it afterwards. This is why you can still send headers in the
middle of a datastream when output buffering is activated.

On Jan 16, 4:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Whitespaces are the bane of my CakePHP existence. Just released a
> program that I developed on a PHP5 dev server to  a PHP4 host and got
> a ton of "Cannot modify header information" errors whenever I use
> $this->redirect X ( . I guess this is more of a rant than anything but
> my question is: Can anyone explain to me what this error is and why
> whitespaces cause it? Also, what is different about PHP5 that it
> doesn't generate this error.
>
> Thanks,
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to