BentCoder
BentCoder

Reputation: 12740

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. 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:

<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

RESTART:

sudo service php5-fpm restart
sudo service apache2 restart

Upvotes: 1

Views: 2911

Answers (2)

gorodezkiy
gorodezkiy

Reputation: 3439

For others who could face this issue, there could be also Apache's ModSecurity setting SecRequestBodyLimit (in case of using Apache) and in system log you'll get the following error:

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

Upvotes: 1

andreimarinescu
andreimarinescu

Reputation: 3641

One thing to check is the maximum post size set in the PHP Suhosin security patch. This complements the settings in your php.ini and might cause the issues that you're seeing. A similar question here: https://serverfault.com/questions/486134/php-cant-increase-maximum-upload-limit

Let me know if it worked.

Upvotes: 0

Related Questions