500内部服务器错误 - 无法使用PHP上传大型视频文件

时间:2022-10-14 21:54:04

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

无法上传大型视频文件(20到100 MB)。已在服务器上设置php.ini文件。

upload_max_filesize = 2000M

upload_max_filesize = 2000M

post_max_size = 2000M

post_max_size = 2000M

max_execution_time = 120

max_execution_time = 120

max_file_uploads = 7

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.

有时上传过程显示40%到60%,然后自动重启上传过程。

using simple move_uploaded_file() php function.

使用简单的move_uploaded_file()php函数。

<?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

1 个解决方案

#1


0  

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.

根据我对这个错误的经验(相信我不是我生命中最好的时期)文件上传时500内部服务器错误通常发生在你的php被配置为以fastcgi运行时。请求您的托管服务提供商和/或服务器管理员增加(或定义它是否尚未定义)FcgidMaxRequestLen aka MaxRequestLen参数的大小。

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

检查此页面并在页面上搜索“500 Internal Server Error”。 http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

#1


0  

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.

根据我对这个错误的经验(相信我不是我生命中最好的时期)文件上传时500内部服务器错误通常发生在你的php被配置为以fastcgi运行时。请求您的托管服务提供商和/或服务器管理员增加(或定义它是否尚未定义)FcgidMaxRequestLen aka MaxRequestLen参数的大小。

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

检查此页面并在页面上搜索“500 Internal Server Error”。 http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html