大文件上传失败的PHP [英] Large file uploads failing php

查看:84
本文介绍了大文件上传失败的PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了一个小型站点,我的朋友可以在其中上传歌曲和他们想要的一些小型文件,但是我的问题是5mb以上的文件失败了,因为在浏览器中显示连接重置错误。

I've made a tiny site where my friends can upload songs and some tiny files that they want to but my problem is that files over 5mb fails, as in the browser shows "Connection reset" error.

服务器设置的最大文件大小为2Mb,但我可以上传2.5-3Mb的罚款文件

可能是因为我用.htaccess覆盖了它

The max file size set by my server is 2Mb, but i can upload 2.5-3Mb fine
Probably because i overwrote it with .htaccess

但是,如果文件上传超过5Mb,它们根本根本不会上传,因为我说过以前的浏览器无法访问服务器。

But however file uploads over 5Mb they just don't get uploaded at all, as i said earlier browser cannot reach server.

应该这是服务器问题吗?还是我的代码有问题?

另外,.htaccess文件中的最大帖子大小和最大文件大小设置为40mb

Would this be a server issue? Or an issue in my code? Will i need to change things in order for large uploads to happen?
Also max post size and max file size is set to 40mb in the .htaccess file

这里是网站
http://sharebay.webatu.com/

您可以尝试上传超过7mb的某些文件,mp3 / flac / aac / m4a / wav /

You can try uploading some files over 7mb, mp3/flac/aac/m4a/wav/

推荐答案

也将它们添加到.htaccess中(将10M调整为所需的MB大小):

Add these to .htaccess as well (adjust 10M to size in MB that you want):

php_value upload_max_filesize 10M
php_value post_max_size 10M

这假设您无权访问php.ini (否则最好放在那里),并且您的主机不禁止在这些值上覆盖htaccess。

This assumes you don't have access to php.ini (otherwise it would be better to put there) and that your host does not prohibit htaccess overrides on these values.

如果您已经尝试过,那么请发布更多有关您的环境。如果您使用的是共享服务器,则可能更改不了多少。

If you've already tried that then post more info about your environment. If you are on a shared server it's probably not something you can change too much.

这篇关于大文件上传失败的PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆