title: PHP - Multiple file upload stuck at 20 items
body: <p>I'm trying to setup a multiple image uploader and whenever I try and upload more than 20 files, only the first 20 files are uploaded. </p>
  
  <p>Before I continue, id just like to say that max_file_uploads in php.ini is setup to 400, so other answers to very similar questions do not seem to resolve my problem.</p>
  
  <p>My full code is below, please note I know I am using mysql_query, but this is just for local testing purposes.</p>
  
  <p>-</p>
  
  <p><strong>PHP</strong> </p>
  
  <pre><code>if(isset($_POST['upload'])){
      include("SimpleImage.php");
  
      echo count($_FILES['file']['name']);
  
      for($i=0; $i&lt;count($_FILES['file']['name']); $i++) {
  
          $allowedExts = array("gif", "jpeg", "jpg", "png", "JPG");
          $extension = end(explode(".", $_FILES["file"]["name"][$i]));
  
          date_default_timezone_set('Europe/London');
          $date = date_create();
  
          if ((($_FILES["file"]["type"][$i] == "image/gif")
          || ($_FILES["file"]["type"][$i] == "image/jpeg")
          || ($_FILES["file"]["type"][$i] == "image/jpg")
          || ($_FILES["file"]["type"][$i] == "image/png"))
          &amp;&amp; ($_FILES["file"]["size"][$i] &lt; 10485760)
          &amp;&amp; in_array($extension, $allowedExts)){
              $name = date_timestamp_get($date) . "_" . mt_rand() . "." . $extension;
  
              if ($_FILES["file"]["error"][$key] &gt; 0){
                  $messages[] = "Return Code: " . $_FILES["file"]["error"][$i] . "&lt;br&gt;";
              }else{
                  $imagethumbTrueLocation = "../../gallery/thumb/" . $name;
                  $imagelargeTrueLocation = "../../gallery/photos/" . $name;
  
                  $imagethumb = new SimpleImage();
                  $imagethumb-&gt;load($_FILES["file"]["tmp_name"][$i]);
                  $imagethumb-&gt;resizeToWidth(230);
                  $imagethumb-&gt;save($imagethumbTrueLocation);
  
                  $imagethumblocation = "thumb/" . $name;
  
                  $imagelarge = new SimpleImage();
                  $imagelarge-&gt;load($_FILES["file"]["tmp_name"][$i]);
                  $imagelarge-&gt;resizeToWidth(800);
                  $imagelarge-&gt;save($imagelargeTrueLocation);
  
                  $imagelargelocation = "photos/" . $name;
  
                  $queryresult = mysql_query("INSERT INTO gallery (thumbnail, highres) VALUES ('$imagethumblocation', '$imagelargelocation')") or die(mysql_error());
                  if(!$queryresult) {
                      $messages[] = "Failed to insert record into the database.";
                  }else{
                      $messages[] = "Record sucessfully added to the database.";
                  }
              }
          }else{
              $messages[] = "Invalid file";
          }
      }
  
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="#" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file[]" id="file" multiple&gt;
      &lt;input type="submit" name="upload" value="Upload" /&gt;
  &lt;/form&gt;
  </code></pre>