F
F
Fedor Ananin2016-04-15 03:37:47
Nginx
Fedor Ananin, 2016-04-15 03:37:47

I get error 413 when uploading a file, what should I do?

Good time!
There is a droplet on DigitalOcean: CentOS 6.4 x32, Vesta CP control panel.
When trying to upload a file with php that is larger than 1MB, an error 413 Request Entity Too Large pops up. Two hours of googling and yandexing did not give any results at all, in the nginx config there is client_max_body_size 100m; I tried to change to 1000, I tried to replace the small m with a large M ... All to no avail.
Added LimitRequestBody and a very large number to the Apache config, added php_value post_max_size 100M and php_value upload_max_filesize 100M to .htaccess - it doesn't help.
By itself after each change of settings did restart of the server.
I have no idea what the problem is ... Maybe someone came across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Averin, 2016-04-21
@averuga

Check the settings in php.ini:
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
# Try putting more than 128?
memory_limit = 32M
;
upload_max_filesize = 100M
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 100M

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question