title: upload large files using php, apache
body: <p>I want to upload files of around 150 MB using PHP and Apache server.
  With my code i can upload upto 5MB</p>
  
  <pre><code>&lt;?php
  
  $path = $_COOKIE['Mypath'];
  $target_path = "uploads/".$path ;
  if(!isDir($target_path))
  {
      mkdir($target_path);
  }
      # Do uploading here
     $target_path = "uploads/".$path ."/";
     $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
     if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
     {
        header("Location: somepage.html");
     } 
     else
     {
          echo "File not uploaded";
     }
  
  ?&gt;
  </code></pre>
  
  <p>php.ini</p>
  
  <pre><code>max_execution_time = 300     ; Maximum execution time of each script, in seconds
  max_input_time = 300    ; Maximum amount of time each script may spend parsing request data
  ;max_input_nesting_level = 64 ; Maximum input variable nesting level
  memory_limit = 128M      ; Maximum amount of memory a script may consume (128MB)
  file_uploads = On
  
  ; Temporary directory for HTTP uploaded files (will use system default if not
  ; specified).
  ;upload_tmp_dir =
  
  ; Maximum allowed size for uploaded files.
  upload_max_filesize = 200M
  </code></pre>