```json
{
    "title": "Compressing Output From PHP",
    "url": "https://performancezen.com/2005/04/30/compressing-output-from-php/",
    "datePublished": "2005-04-30",
    "dateModified": "2005-04-30",
    "language": "en-US",
    "description": "A little-used or discussed feature of PHP is the ability to compress output from the scripts using GZIP for more efficient transfer to requesting clients. By automatically detecting the ability…",
    "author": "spierzchala",
    "publisher": "Performance Zen"
}
```

# Compressing Output From PHP

> **Apache/1.3.x**
>  *./configure --with-apxs=/usr/local/apache/bin/apxs --with-zlib*
>  **Apache/2.0.x**
>  *./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib*

> **Method 1:**
>  output_buffering = On
>  output_handler = ob_gzhandler
>  zlib.output_compression = Off

> **Method 2:**
>  output_buffering = Off
>  output_handler =
>  zlib.output_compression = On
