Narendra Verma
Narendra Verma

Reputation: 195

500 Internal Server Error - Unable to upload large video files using PHP

Not able to upload large video file up to(20 to 100 MB). Already setup php.ini file on server .

upload_max_filesize = 2000M

post_max_size = 2000M

max_execution_time = 120

max_file_uploads = 7

memory_limit=128M

Getting

"HTTP Error 500.0 - Internal Server Error The page cannot be displayed
 because an internal server error has occurred."

or

"This page is not available."

sometime uploading process is shows 40 to 60 percent then its automatically restart the uploading process.

using simple move_uploaded_file() php function.

<?php 
ini_set('max_execution_time', 50000);
 $target = "upload/"; 
 $target = $target . basename( $_FILES['uploaded']['name']) ; 
 if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
    {
    echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded";
    } 
     else 
     {
     echo "Sorry, there was a problem uploading your file.";
     }
 ?>

Thanks

Upvotes: 2

Views: 4592

Answers (1)

Ergec
Ergec

Reputation: 11824

Based on my experience about this error (trust me was not the best times of my life) 500 Internal Server Error on file uploads usually happens when your php is configured to run as fastcgi . Ask your hosting provider and/or server administrator to increase (or define if it's not already defined) the size of FcgidMaxRequestLen aka MaxRequestLen parameter.

Check this page and search "500 Internal Server Error" on the page. http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

Upvotes: 1

Related Questions