Uploading Theme To Wordpress and Get 413 Request Entity Too Large

  • Posted March 26, 2014


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


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

nginx.conf <br>add/increase client_max_body_size in the nginx configuration file http area/section: <br>http { <br>client_max_body_size 32m; <br>(other lines will also be here) <br>} <br> <br>reference: <br> <br> <br> <br>php.ini <br>Check and/or increase the following: <br>upload_max_filesize = 32M <br>post_max_size = 32M <br> <br>Optionally increase: <br>max_execution_time =300 <br>max_input_time=300 <br>memory_limit =128M <br> <br>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. <br> <br>Otherwise, you could most likely upload your theme by ftp instead if it’s available. <br> <br>Additionally you can set the above examples to suit your needs.

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”

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.

If you’re using vim, you need to press Escape, type <code>:wq</code>, and press Enter to save a file.

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? <br>vim /etc/nginx/nginx.conf.