Skip to main content
All CollectionsPHPPHP Advanced
How to Disable PHP output_buffering
How to Disable PHP output_buffering

Disabling output_buffering via the .htaccess file

Updated over a year ago

Output buffering is a process involving the collection and storage of a PHP script's output or content before sending it to the web browser, instead of sending it immediately. It helps improve performance by sending larger amounts of data at once, allowing to modify content before sending it, as well as controlling the order in which content is delivered.

While output buffering can be useful, there are situations where you might want to disable it. For example, if you're working with dynamic content, or if your PHP application or framework already has a buffer set up.

To disable output buffering, open the .htaccess file using the File Editor. If the file is not present in the public_html folder of your website, create it.

Next, add the following line:

php_value output_buffering Off

Once done, click on Save to apply the changes.

With output buffering disabled, now you can have an improved dynamic content performance and prevent buffering conflicts.

Did this answer your question?