提高上传限制
我有一个 PHP Web 应用程序,用户可以在其中上传文件。我需要将我的 VPS 的限制提高到 2GB,该 VPS 具有 512mb 内存和 256mb 交换空间。我尝试通过更改 upload_max_filesize 和 post_max_size 来提高限制。当我将限制提高到 150mb 时它有效,但当我将其更改为 250mb 时则无效。知道是什么限制了它吗?
**更新
我的主机是 linode,我运行的是 512mb VPS。
我运行的是 Ubuntu 10.04,并使用默认设置的 apache2。我正在更改 .htaccess 文件中的限制。
I have a PHP web application and where users a upload files. I need to raise the limit to 2gb on my VPS that has 512mb of memory and 256mb of swap space. I have tried raise the limit by changing upload_max_filesize and post_max_size. It works when I raise the limit to 150mb, but not when I change it to 250mb. Any idea what is limiting it?
**UPDATE
My host is linode and I am running the 512mb VPS.
I am running Ubuntu 10.04 and am using apache2 with the default settings. I am changing the limit in my .htaccess file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能是你的主人限制了你。 512MB 对于服务器来说是非常小的 RAM,因此他们限制它以防止崩溃或其他问题。
Probably your host is limiting you. 512MB is very small amount of RAM for a server, so they restricted it to prevent crash or something.
请注意:
1.您的VPS可能对其可使用的磁盘空间有限制,这可能会导致错误
2.由于编码和POST的附加数据,post_max_size必须比upload_max_filesize大一点。例如,如果您有:
upload_max_filesize = 100M
post_max_size = 100M
并且您的文件为 99.99MB,则可能会因此失败。
给 post_max_size 多出 5% 的空间,以保证安全。
Please note:
1. Your VPS may have limitation about disk space that it can use and that may cause the error
2. That post_max_size must be a little bigger than upload_max_filesize because of the encoding and POST's additional data. For example if you have:
upload_max_filesize = 100M
post_max_size = 100M
and your file is 99.99MB it may fail because of that.
Give post_max_size 5% more room to be on the sure side.