【问题标题】:500 Internal Server Error - Unable to upload large video files using PHP500 内部服务器错误 - 无法使用 PHP 上传大型视频文件
【发布时间】:2014-03-01 11:47:43
【问题描述】:

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

upload_max_filesize = 2000M

post_max_size = 2000M

max_execution_time = 120

max_file_uploads = 7

memory_limit=128M

得到

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

"This page is not available."

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

使用简单的 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.";
     }
 ?>

谢谢

【问题讨论】:

标签: php file-upload jquery-file-upload


【解决方案1】:

根据我对这个错误的经验(相信我不是我生命中最美好的时光) 500 Internal Server Error on file uploads 通常发生在您的 php 配置为以 fastcgi 运行时。要求您的托管服务提供商和/或服务器管理员增加(或定义如果尚未定义)FcgidMaxRequestLen aka MaxRequestLen 参数的大小。

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

【讨论】:

    猜你喜欢
    • 2018-03-18
    • 1970-01-01
    • 2012-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-11
    • 2016-02-19
    • 1970-01-01
    相关资源
    最近更新 更多