我试图让用户上传最多30MB,但服务器挂起甚至不产生错误。在浏览器的网络条检查中甚至没有错误。在互联网上阅读了大量信息后,我做了以下更改,但到目前为止还没有运气。有人知道我还能做什么吗?
Thanks in advance
. 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中
post_max_size 40M
upload_max_filesize 35M
max_execution_time 1200
max_input_time 1200
重启:
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)
要检查的一件事是PHP Suhosin安全补丁中设置的最大帖子大小。这补充了php.ini中的设置,并可能导致您所看到的问题。这里有一个类似的问题:https://serverfault.com/questions/486134/php-cant-increase-maximum-upload-limit