#43366 [NEW]: POST: Allowed memory size exhausted in Unknown on line 0

From: Date: Wed, 21 Nov 2007 19:50:21 +0000
Subject: #43366 [NEW]: POST: Allowed memory size exhausted in Unknown on line 0
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-254@lists.php.net to get a copy of this message
From: yvan dot taviaud at m4am dot net Operating system: Linux Debian Etch PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: POST: Allowed memory size exhausted in Unknown on line 0 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 -- Edit bug report at http://bugs.php.net/?id=43366&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43366&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43366&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43366&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43366&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43366&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43366&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43366&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43366&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43366&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43366&r=support Expected behavior: http://bugs.php.net/fix.php?id=43366&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43366&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43366&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43366&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43366&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43366&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43366&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43366&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43366&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43366&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43366&r=mysqlcfg

« previous php.doc.bugs (#254) next »