# A question about ap_content_length_filter()

- Thread: https://externals.io/message/44210
- Original archive: https://news-web.php.net/php.internals/44210
- Started by Peter Wang on 2009-06-09T11:54:16+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #44210 — Peter Wang — 2009-06-09T11:54:16+00:00

URL: https://externals.io/message/44210#44210

hi, all.

<code>
<?php
// ~/www/htdocs/v.php
header("Content-Type: text/plain");
echo str_repeat('a', intval($_GET['s']));
?>
</code>

test the php code above,
when request with "/v.php?s=8000", I got

HTTP/1.1 200 OK
Date: Tue, 09 Jun 2009 11:41:54 GMT
Server: Apache
Content-Length: 8000
Connection: close
Content-Type: text/plain

it's fine, but while request with "/v.php?s=8001", i got:

HTTP/1.1 200 OK
Date: Tue, 09 Jun 2009 11:43:09 GMT
Server: Apache
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain

so, my question is: when response size <= 8000,
the request contains a Content-Length field,
otherwise, it uses chunked.

8000 may be very specific on my server, i wonder
where can i tuning such a limit. I have tried to
change output_buffering in php.ini from 4096 to
8192 to tuning that limit, but it seems nothing changes.

thanks for your suggestions.
