> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enabling and disabling the PHP output_buffering directive

> Discover how to manage the output_buffering directive in a custom php.ini with code snippets and clear instructions.

This article describes how to enable and disable the **output\_buffering** directive in a custom *php.ini* file.

<Warning>
  **Important**

  The information in this article only applies to certain types of hosting accounts. To determine whether or not the information below applies to your account, please see [this article](/docs/changing-php-settings-and-versions).

  📘 Note

  This article assumes that you have already set up a custom *php.ini* file on your web site. If you have not already set up a custom *php.ini* file, please read [this article](/docs/custom-php-ini-files) first.
</Warning>

## Using the output\_buffering directive

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:

* Output buffering enables you to send headers to the client *after* PHP has started processing a script.

* Output buffering may improve site performance.

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
```

<Tip>
  To verify the current value of the **output\_buffering** directive and other directives, you can use the **phpinfo()** function. For more information about how to do this, please see [this article](/docs/view-php-settings).
</Tip>

## More information

* To view a complete list of *php.ini* directives, please visit [http://www.php.net/manual/en/ini.list.php](http://www.php.net/manual/en/ini.list.php).

* For more information about the **output\_buffering** directive, please visit [http://php.net/manual/en/outcontrol.configuration.php](http://php.net/manual/en/outcontrol.configuration.php).

## Related articles

* [Custom php.ini files](/docs/custom-php-ini-files)

* [Using php.ini directives](/docs/using-php-ini-directives)
