I'm trying to allow users to upload large files (64MB) and am planning to change upload_max_filesize
to 64MB.
However, should I also change memory_limit
to 64MB or larger?
Is memory_limit
connected to upload_max_filesize
?
A typical appropriate memory limit for PHP running Drupal is 128MB per process; for sites with a lot of contributed modules or with high-memory pages, 256MB or even 512MB may be more appropriate.
In order to preserve your server's resources, hosts set a limit on the maximum size of a file that can be uploaded. This maximum, in megabytes, is defined in the upload_max_filesize directive. The upload_max_filesize directive itself is located in the php.
Navigate to your php.Locate the upload_max_filesize and increase it by changing its number. You can also boost a few other limitations, as shown below: upload_max_filesize = 256M post_max_size = 256M memory_limit = 512M max_execution_time = 180. Save the file, and that's it. The error should no longer occur.
No, it's not necessary.
PHP has different POST readers and handlers depending on the content type of the request. In case of "multipart/form-data" (what is used for sending files), rfc1867_post_handler
acts as a mixed reader/handler. It populates both $_POST
and $_FILES
. What goes into $_POST
counts towards the memory limit, what goes into $_FILES
also counts.
However, $_FILES
has just meta-data about the files, not the files themselves. Those are just written into the disk and hence don't count towards the memory limit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With