# Disabling the built-in POST handler

- Thread: https://externals.io/message/33370
- Original archive: https://news-web.php.net/php.internals/33370
- Started by Stefanos Stamatis on 2007-11-21T17:30:10+00:00
- Messages: 3
- 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

---

## #33370 — Stefanos Stamatis — 2007-11-21T17:30:10+00:00

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

Trying to find a way to disable the built-in post form handler
for the reasons discussed here:
http://marc.info/?l=php-general&m=119160177617046&w=2
I looked at the code of php and found out that inside main/rfc1867.c in
function rfc1867_post_handler there is a check whether the posted data
content length exceeds the post_max_size parameter.
If so it aborts the function (with a warning).

(php-5.2.5, main/rfc1867.c, line 798)

        if (SG(request_info).content_length > SG(post_max_size)) {
                sapi_module.sapi_error(E_WARNING, "POST Content-Length of
%ld bytes exceeds the limit of %ld bytes",
SG(request_info).content_leng
th, SG(post_max_size));
                return;
        }

So setting post_max_size to zero for the script with php_value in the
apache configuration disables the built-in post form handler resulting in
the desired behaviour!

My question is whether this is the expected behavior of php that we can
count on and can be used as a solution to our problem.

Thanks in advance,
Stefanos Stamatis.

---

## #33373 — Hannes Magnusson — 2007-11-21T20:13:28+00:00

URL: https://externals.io/message/33370#33373 · In reply to: #33370

> So setting post_max_size to zero for the script with php_value in the
> apache configuration disables the built-in post form handler resulting in
> the desired behaviour!
>
> My question is whether this is the expected behavior of php that we can
> count on and can be used as a solution to our problem.

Yes. http://www.php.net/manual/en/ini.core.php#ini.post-max-size

-Hannes

---

## #33377 — Richard Quadling — 2007-11-22T10:09:21+00:00

URL: https://externals.io/message/33370#33377 · In reply to: #33373

> 
> > […]
>
> Yes. http://www.php.net/manual/en/ini.core.php#ini.post-max-size
>
> -Hannes

Would it be worth stating specifically that a post-max-size of zero
inhibits $_POST/$_FILES?
-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
