在PHP设置中,memory_limit> upload_max_filesize? [英] In PHP settings, should memory_limit > upload_max_filesize?

查看:73
本文介绍了在PHP设置中,memory_limit> upload_max_filesize?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图允许用户上传大文件(64MB),并计划将upload_max_filesize更改为64MB.

I'm trying to allow users to upload large files (64MB) and am planning to change upload_max_filesize to 64MB.

但是,我还应该将memory_limit更改为64MB或更大吗?

However, should I also change memory_limit to 64MB or larger?

memory_limit是否已连接到upload_max_filesize?

推荐答案

否,没有必要.

PHP具有不同的POST读取器和处理程序,具体取决于请求的内容类型.如果是"multipart/form-data"(用于发送文件的内容),

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.

但是,$_FILES只是有关文件的元数据,而不是文件本身.这些只是写入磁盘,因此不计入内存限制.

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.

这篇关于在PHP设置中,memory_limit> upload_max_filesize?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆