Report this

What is the reason for this report?

Uploading Theme To Wordpress and Get 413 Request Entity Too Large

Posted on March 26, 2014

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



This textbox defaults to using Markdown to format your 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.

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”

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>http://wiki.nginx.org/HttpCoreModule#client_max_body_size <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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.