Uploading Theme To Wordpress and Get 413 Request Entity Too Large

Posted March 26, 2014 41.1k views
Hello, I have followed all the tuts on this site, I have a Wordpress Nginx install. When I try to install a theme; however, I don't get this when installing plugins or any other thing. I get Get 413 Request Entity Too Large error. Any help would be grateful. Thanks, C

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
add/increase client_max_body_size in the nginx configuration file http area/section:
http {
client_max_body_size 32m;
(other lines will also be here)


Check and/or increase the following:
upload_max_filesize = 32M
post_max_size = 32M

Optionally increase:
max_execution_time =300
memory_limit =128M

Restart nginx or your server for the changes to take effect after applying changes. The default client_max_body_size is 1 megabyte so most likely your theme is larger than 1 mb and you need to increase it to an amount larger than the size of the theme you are trying to install.

Otherwise, you could most likely upload your theme by ftp instead if it's available.

Additionally you can set the above examples to suit your needs.
  • Hi, i am also getting this 413 error. So, in the nginx.conf i set the clientmaxbodysize to 32M, in the php.ini, the uploadmaxfilesize to 32M and the postmax_size to 33M, and the optionally increase to. But i still getting the 413. Any help?

    • I’m using Wordpress Multisites and i increase the Maximum upload file size in the network admin to 30M.

    Thak you

I want to ask you i add line in server but when i go to save file with ctrl x i am unable to save ,can u tell me how to save nginx conf file?
vim /etc/nginx/nginx.conf.
If you're using vim, you need to press Escape, type :wq, and press Enter to save a file.

For anyone having trouble locating the php.ini file, mine was located at /etc/php/7.0/fpm/php.ini. Placing a php.ini file in the /wp-admin folder did not work for me. I also ended up rebooting the server after I made changes to php.ini, then the new upload limit worked perfectly.

One thing that got me initially when the suggested changes didn’t work, was that in addition to restarting nginx, I also had to restart php-fpm as well before I was able to successfully upload files to Wordpress.

“# service php-fpm restart”