【发布时间】: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.";
}
?>
谢谢
【问题讨论】:
-
当您收到 500 Internal Server 错误时,您应该始终做的第一件事就是查看服务器的日志文件。
标签: php file-upload jquery-file-upload