php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43366 POST: Allowed memory size exhausted in Unknown on line 0
Submitted: 2007-11-21 19:50 UTC Modified: 2008-11-07 15:09 UTC
Votes:11
Avg. Score:4.0 ± 0.9
Reproduced:9 of 9 (100.0%)
Same Version:4 (44.4%)
Same OS:4 (44.4%)
From: yvan dot taviaud at m4am dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Linux Debian Etch
Private report: No CVE-ID: None
 [2007-11-21 19:50 UTC] yvan dot taviaud at m4am dot net
Description:
------------
Allowed memory size problem when POSTing on a PHP script with 1.5MB data that turns out to be 8MB+ when PHP populates its internal variables ($_POST and so on).

This should be better documented in the manual I think, as the default post_max_size is 8M, the same as memory_limit (now I know memory_limit should be 128MB).

So this is really confusing, as:
- the script name is ?Unknown?
- post_max_size is too high for this type of error (if not using $_FILES) as memory_limit fires up first
- too much time spent on this :-(

Reproduce code:
---------------
Run a POST request with enough data again any PHP script.

Expected result:
----------------
At least the filename in the error (line should still be 0), such as:
PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 1412991 bytes) in /path/to/my/script.php on line 0

Same thing for POST-max-size error would be great:
PHP Warning:  Unknown: POST Content-Length of 2250121 bytes exceeds the limit of 1048576 bytes in /path/to/my/script.php on line 0

Actual result:
--------------
PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 1412991 bytes) in Unknown on line 0
PHP Warning:  Unknown: POST Content-Length of 2250121 bytes exceeds the limit of 1048576 bytes in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-07 15:09 UTC] vrana@php.net
Nothing to document.
 [2010-03-24 21:59 UTC] info at overtrend dot com
I got the similar error after editing php.ini

What I did was change the upload and post limit to 3200MB.

After taking it back to 32 problem was gone...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 10:01:31 2024 UTC