Doc #65389 [Ana->Csd]: Correlation between memory_limit and post_max_size
| From: | cmb@php.net | Date: | Wed, 05 Aug 2015 14:56:42 +0000 |
| Subject: | Doc #65389 [Ana->Csd]: Correlation between memory_limit and post_max_size | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12581@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65389&edit=1
ID: 65389
Updated by: cmb@php.net
Reported by: marc at ermshaus dot org
Summary: Correlation between memory_limit and post_max_size
-Status: Analyzed
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2015-08-05 14:56:12] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337294
Log: removed out-dated info that file uploads are restricted by memory_limit (fixes
#65389)
------------------------------------------------------------------------
[2015-08-05 14:49:03] cmb@php.net
> This report is valid, since newer handler does not consume
> memory.
The "newer handler" basically seems to be in place since 2001[1]
(i.e. long before PHP 5.0.0), so the documentation doesn't have to
mention it in the changelog.
[1] <https://github.com/php/php-src/commit/44b68122c2ba0cf07cd837af160b3bd01527d081>
------------------------------------------------------------------------
[2013-08-18 07:27:51] yohgaki@php.net
This report is valid, since newer handler does not consume memory. Current
documentation is valid for old PHPs which are no longer supported.
------------------------------------------------------------------------
[2013-08-05 09:21:24] marc at ermshaus dot org
Description:
------------
This is more or less a duplicate of this bug report:
- https://bugs.php.net/bug.php?id=52229
I am opening a new one because I think my comment there went by unnoticed.
http://www.php.net/manual/en/ini.core.php#ini.post-max-size
states:
âIf memory limit is enabled by your configure script, memory_limit also affects
file uploading. Generally speaking, memory_limit should be larger than
post_max_size.â
To me, the phrasing is misleading as it implies that file uploads (<input
type="file">, multipart/form-data, $_FILES array) have to fit into
memory_limit. That is probably not the case. It is my understanding that the
second sentence from the quote only holds true for large
application/x-www-form-urlencoded POST requests (without file uploads) while
the first sentence is more or less incorrect/superfluous.
For example, uploading two 4M files with settings memory_limit 2M,
post_max_size 10M, upload_max_filesize 5M should work. 4M < upload_max_filesize
and 4M+4M < post_max_size. memory_limit should not affect this at all.
Other mentions and discussion of this issue:
- http://stackoverflow.com/questions/3651141/in-php-settings-should-memory-limit-upload-max-filesize
- http://stackoverflow.com/questions/5106871/relationship-between-phps-memory-limit-upload-max-filesize-and-post-max-filesi
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65389&edit=1