PHP:上传大文件时遇到问题 [英] PHP: Having trouble uploading large files

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

问题描述

我正在使用 PHP 上传文件,这对于我的本地主机上大小为 2.8MB 的文件工作正常 - 但不适用于我的 Mediatemple GS 主机.小于 2MB 的文件可以正常工作,但任何更大的文件似乎都不起作用...我没有收到任何错误消息但是当上传完成时,在上传目录中找不到该文件...

I am doing a file upload using PHP, which works fine for a file of size 2.8MB on my localhost - but not my Mediatemple GS host. Files smaller than 2MB work fine, but anything larger seems to not work... I am not getting any error message but when the upload finishes, the file is not found in the uploads directory...

我用谷歌搜索了一下,然后在 .htaccess 文件中添加了以下几行:

I googled around, and I added the following lines to the .htaccess file:

php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G

我知道上面的一些值有点矫枉过正,但即便如此,这似乎也无济于事......我可能还缺少什么?

I know some of the above values are a overkill, but even then, this does not seem to help... Anything else I might be missing?

推荐答案

你错过的是 max_input_time,并检查您的编辑是否反映在 phpinfo(); 中.

The one you missed is max_input_time, and do check whether your edits are reflected in phpinfo();.

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

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