This article describes how to enable and disable the output_buffering directive in a custom php.ini file.
By default, when PHP processes a script, it sends output to the client in multiple chunks until script processing is complete. You can change this behavior and set PHP to buffer output during script processing instead.
When output buffering is enabled, PHP sends all of the output to the client only after script processing is complete. There are two main reasons why you may want to do this:
To enable output buffering, use a text editor to modify the output_buffering directive in the php.ini file as follows:
output_buffering = on
Alternatively, to enable output buffering and limit the buffer to a specific size, use a numeric value instead of on. For example, to set the maximum size of the output buffer to 16384 bytes, modify the output_buffering directive in the php.ini file as follows:
output_buffering = 16384
To disable output buffering, modify the output_buffering directive in the php.ini file as follows:
output_buffering = off
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.