By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,874 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

Confusion about output_buffering setting

P: n/a
(I've googled this to no avail.)

I'm using PHP + Apache for building a website.

The PHP docs for the "output_buffering" setting say:

"You can enable output buffering for all files by setting this
directive to 'On'."
http://www.php.net/manual/en/outcont...figuration.php

1. Does this mean that PHP will automagically do an ob_start before
the script starts executing and an ob_end_flush at the end of script
execution?

2. If so, what are the consequences of calling ob_start within the
script? Does that just start a "stacked" output buffer?
The docs for the setting go on to say:

"...you can use a maximum number of bytes instead of 'On', as a value
for this directive (e.g., output_buffering=4096)."

3. They don't specify what happens when this buffer fills. Is the
contents of the buffer then automatically sent to the user?

Thanks for any help,

Walter
Aug 18 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 18 Aug, 18:55, WalterGR <walte...@gmail.comwrote:
(I've googled this to no avail.)

I'm using PHP + Apache for building a website.

The PHP docs for the "output_buffering" setting say:

"You can enable output buffering for all files by setting this
directive to 'On'."http://www.php.net/manual/en/outcontrol.configuration.php

1. Does this mean that PHP will automagically do an ob_start before
the script starts executing and an ob_end_flush at the end of script
execution?

2. If so, what are the consequences of calling ob_start within the
script? Does that just start a "stacked" output buffer?

The docs for the setting go on to say:

"...you can use a maximum number of bytes instead of 'On', as a value
for this directive (e.g., output_buffering=4096)."

3. They don't specify what happens when this buffer fills. Is the
contents of the buffer then automatically sent to the user?

Thanks for any help,

Walter
Why don't you try it and see what happens?

C.
Aug 19 '08 #2

P: n/a
On Aug 19, 3:29 am, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@gmail.comwrote:
On 18 Aug, 18:55, WalterGR <walte...@gmail.comwrote:
(I've googled this to no avail.)
I'm using PHP + Apache for building a website.
The PHP docs for the "output_buffering" setting say:
"You can enable output buffering for all files by setting this
directive to 'On'."http://www.php.net/manual/en/outcontrol.configuration.php
1. Does this mean that PHP will automagically do an ob_start before
the script starts executing and an ob_end_flush at the end of script
execution?
2. If so, what are the consequences of calling ob_start within the
script? Does that just start a "stacked" output buffer?
The docs for the setting go on to say:
"...you can use a maximum number of bytes instead of 'On', as a value
for this directive (e.g., output_buffering=4096)."
3. They don't specify what happens when this buffer fills. Is the
contents of the buffer then automatically sent to the user?
Thanks for any help,
Walter

Why don't you try it and see what happens?

C.
Because just because it works in PHP version x.y.z doesn't mean that
it is the intended behavior and will continue to work in version x.y.z
+1.

I'd be happy to do some experimentation, but I don't know how to
detect when PHP flushes a buffer and sends output to the user. Any
thoughts?

Thanks,

Walter
Aug 19 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.