简体   繁体   English

无法上传大于10MB的文件

[英]Cannot upload files bigger than 10MB

I'm trying to let user upload up to 30MB max but the server hangs not even produce an error. 我试图让用户上传最大30MB的内存,但是服务器挂起甚至不会产生错误。 Not even error in browser network bar in inspection. 甚至没有检查浏览器网络栏中的错误。 I did changes below after reading whole lot of info on Internet but no luck so far. 在阅读了互联网上的全部信息之后,我做了下面的更改,但到目前为止还没有运气。 Anyone knows what else I can do? 有人知道我还能做什么吗?

Thanks in advance 提前致谢

.htaccess: 的.htaccess:

<IfModule mod_php5.c>
    php_value post_max_size 40M
    php_value upload_max_filesize 350M
    php_value max_execution_time 1200
    php_value max_input_time 1200
</IfModule>

/etc/php5/{cli,fpm}/php.ini /etc/php5/{cli,fpm}/php.ini

post_max_size 40M
upload_max_filesize 35M
max_execution_time 1200
max_input_time 1200

RESTART: 重新开始:

sudo service php5-fpm restart
sudo service apache2 restart

对于可能会遇到此问题的其他人,可能还会有Apache的ModSecurity设置SecRequestBodyLimit (在使用Apache的情况下),并且在系统日志中会出现以下错误:

ModSecurity: Request body (Content-Length) is larger than the configured limit (10485760)

One thing to check is the maximum post size set in the PHP Suhosin security patch. 要检查的一件事是PHP Suhosin安全补丁中设置的最大帖子大小。 This complements the settings in your php.ini and might cause the issues that you're seeing. 这是对php.ini中设置的补充,可能会引起您所看到的问题。 A similar question here: https://serverfault.com/questions/486134/php-cant-increase-maximum-upload-limit 一个类似的问题在这里: https : //serverfault.com/questions/486134/php-cant-increase-maximum-upload-limit

Let me know if it worked. 让我知道它是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM