php 已超出允许的最大文件上传数量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4438551/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 13:03:36  来源:igfitidea点击:

Maximum number of allowable file uploads has been exceeded

phpapachefile-upload

提问by HyderA

We're uploading about 500 images at a time

我们一次上传大约 500 张图片

max_file_uploads = 600
memory_limit = 200M ( most images are 12-15KB )
post_max_size = 200M

Why are we still getting that warning?

为什么我们仍然收到那个警告?

EDIT: All these variables are set in the php.ini file and confirmed by checking using phpinfo();

编辑:所有这些变量都在 php.ini 文件中设置,并通过使用 phpinfo() 进行检查来确认;

采纳答案by álvaro González

The PHP script won't even start executing until all the files have been uploaded. That means that you cannot change the max_file_uploadsdirective from within PHP, e.g. with ini_set(): you need to do it in the php.inifile. Otherwise, when you change the setting the limit has already been hit.

PHP 脚本在所有文件都上传之前甚至不会开始执行。这意味着您不能max_file_uploads从 PHP 内部更改指令,例如ini_set():您需要在php.ini文件中进行更改。否则,当您更改设置时,已达到限制。

回答by Shakti Singh

add max_file_uploads=500 to php.ini