PHP Tutorials
Php What isPHP INI Tutorials
Php ini What isAnybody with even minimal PHP experience is likely quite familiar with the following two messages:
These messages occur when a script attempts to modify a header after it has already been sent back to the requesting user. Most commonly they are the result of the programmer attempting to send a cookie to the user after some output has already been sent back to the browser, which is impossible to accomplish because the header (not seen by the user, but used by the browser) will always precede that output.
PHP version 4.0 offered a solution to this annoying problem by introducing the concept of output buffering When enabled, output buffering tells PHP to send all output at once, after the script has been completed. This way, any subsequent changes to the header can be made throughout the script because it hasn't yet been sent.
Note: Output buffering can also be controlled via Output Buffering Control functions.Possible Values:
Note: This directive is hardcoded to Off for the CLI SAPI
Enabling the output_buffering directive turns output buffering on. Alternatively, you can limit the size of the output buffer (thereby implicitly enabling output buffering) by setting it to the maximum number of bytes you'd like this buffer to contain.
If you do not plan to use output buffering, you should disable this directive because it will hinder performance slightly. Of course, the easiest solution to the header issue is simply to pass the information before any other content whenever possible.
|
Tweet |
|
|