我可以在我的phpinfo上看到max_file_uploads=100
。
我想一起上传大约100个文件。但我发现它不会发布更多的25个文件输入。 为测试我做了以下脚本
<form action="filecheck.php" method="post" enctype="multipart/form-data">
<?php
for($i=1;$i<=100;$i++)
{
if(($i%5)==0)
{
echo '<br>';
}
echo $i." ";
?>
<input type="file" name="file_<?=$i?>">
<?php
}
?>
<input type="submit" value="Save">
</form>
我的filechceck.php是这样的
echo "<pre>";
print_r($_FILES);
echo "</pre>";
我只选择第一个和第100个文件,然后点击保存。
在我的localhost中输出正常,就像这样
Array
(
[file_1] => Array
(
[name] => a.txt
[type] => text/plain
[tmp_name] => *****\php8019.tmp
[error] => 0
[size] => 203
)
[file_2] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
....
[file_99] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[file_100] => Array
(
[name] => b.txt
[type] => text/plain
[tmp_name] => ****\php801A.tmp
[error] => 0
[size] => 203
)
)
但在我的直播服务器上它显示如下
Array
(
[file_1] => Array
(
[name] => a.txt
[type] => text/plain
[tmp_name] => /tmp/phplbJzsi
[error] => 0
[size] => 203
)
[file_2] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
....
[file_24] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
[file_25] => Array
(
[name] =>
[type] =>
[tmp_name] =>
[error] => 4
[size] => 0
)
)
我需要在php.ini上设置其他内容吗?作为我的本地服务器完美地工作?
答案 0 :(得分:1)
您正在运行suhosin,将其限制为25:
suhosin.upload.max_uploads 25 25
Op与我分享他的Atomically
输出