title: How To Increase Maximum File Upload Size (PHP)?
body: <p>I am running a XAMPP server on my computer. The maximum file size I've uploaded is 24.3kb. My server fails to upload a 78kb file. I know because I get an empty $_FILES['file']['tmp_name'] and an error when attempting to move the file.</p>
  
  <p>I went into php.ini and changed the two variables: upload_max_filesize = 2M and post_max_size = 8M, both to over 100, although it should have worked at 2megabytes and 8 megabytes. Still no success.</p>
  
  <p>I am a little new to php but I did enable all logs and I tried to check error logs but the only one with relevant information was the php error log and the only error I see is 'undefined index in file path/tp/myfile.php on line 13'. Any other error logs I should check?</p>
  
  <p>I looked at a lot of forums and threads and I can't find why mine is not working.</p>
  
  <p>[EDIT] I do have the right encryption type. (I DID after all get one image to upload).
  enctype="multipart/form-data</p>
  
  <p>[EDIT2] My php script:
  Just incase your curious, this is an exercise in 'Head First php mysql'
      </p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit'])){
      $first_name = $_POST['first_name'];
      $last_name = $_POST['last_name'];
      $score = $_POST['score'];
      $screenshot = $_FILES['screenshot']['name'];
      $target_directory = "images/$screenshot";
      $tmp_directory = $_FILES['screenshot']['tmp_name'];
  
      echo "echoing" . $tmp_directory;
  
      move_uploaded_file($tmp_directory, $target_directory) or die("Failed to move");
  
  $db = "guitarwars";
  $table = "highscoretable";
  
  $dbc = mysqli_connect(privateinfor) or die("Failed to connect to server");
  mysqli_select_db($dbc, $db) or die("Failed to select database");
  
  $query = "INSERT INTO $table VALUES(0, NOW(), '$first_name', '$last_name', '$score', '$screenshot')";
  
  //mysqli_query($dbc, $query) or die("Failed to query database");
  
  }else{
  
  ?&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;style type="text/css"&gt;
              .container {
                  width: 100%;
              }
              .container label{
              }
          &lt;/style&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
      &lt;h1&gt;Guitar Wars - Add Your High Score&lt;/h1&gt;
      &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post" enctype="multipart/form-data"&gt;
          &lt;div class="container"&gt;
          &lt;input type="hidden" name="MAX_FILE_SIZE" value="32768" enctype="multipart/form-data"/&gt;
          &lt;label for="first_name"&gt;First Name:&lt;/label&gt; 
          &lt;input type="text" size="32" maxlength="32" value="&lt;?php echo $first_name; ?&gt;" placeholder="First Name" id="first_name" name="first_name"/&gt;
          &lt;label for="last_name"&gt;Last Name:&lt;/label&gt; 
          &lt;input type="text" size="32" maxlength="32" value="&lt;?php echo $last_name; ?&gt;" placeholder="Last Name" id="last_name" name="last_name"/&gt;&lt;/br&gt;
          &lt;label for="score"&gt;Score:&lt;/label&gt; 
          &lt;input type="text" size="11" maxlength="11" placeholder="Enter score" value="&lt;?php echo $score; ?&gt;" id="score" name="score"/&gt;&lt;/br&gt;
          &lt;label for="screenshot"&gt;Screenshot:&lt;/label&gt; 
          &lt;input type="file" id="screenshot" name="screenshot"/&gt;&lt;/br&gt;
          &lt;input type="submit" name="submit" value="submit" /&gt;
          &lt;/div&gt;
      &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
      }
  ?&gt;
  </code></pre>