Header Rewrite Puzzle |
|
look for output_buffering in your php.ini, in your live environment this is probably enabled
|
||||||||||||
_________________ MV |
|
Thanks for such a prompt response. Yes output_buffering is set to 4096. Is the the issue, if so can I safely set this for the debugger version of PHP?
Charlie |
||||||||||||
|
|
you can do it in you test environment too, but it's better to use the build in php functions for output buffering
http://www.php.net/manual/en/function.ob-start.php |
||||||||||||
_________________ MV |
|
just insert an explicit ob_start() in testrewrite.php/line1, so your script is portable.
|
||||||||||||
|
|
Thanks both. Since your post I've been looking over output buffering and it seems that it offers some really interesting possibilities but I shall have to take time out to experiment. I guess the ob_start() idea gives me time and keeps both the development and live environments running together.
|
||||||||||||
|
Site Admin
|
in fact, HTTP headers are always sent before HTTP body. PHP output buffer (ob_xxx) when enabled delays sending the body. Thus it leaves a chance to send headers after some ECHOs are done and some parts of HTTP body is sent to the output. Without buffer you get an error saying that you can't send headers because it's too late (or it's quite misleading equivalent in php's terms: Cannot modify header information)
I'd recommend to have all headers sent before the body. In this case you don't have to rely on ob status:
Also, please note that 'Location: xxx' header does not require any body, so you can have just
|
||||||||||||||||
_________________ The PHP IDE team |
|
Thanks Dmitri.
Charlie |
||||||||||||
|
Header Rewrite Puzzle |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by