How to increase PHP file upload limit with PHP FPM and Nginx

wordpress increase upload size

If while uploading a file you get an error with the following text in it :
"client intended to send too large body:"

You can fix this error by increasing the PHP File-Upload Limit as following :

Step 1: Open php.ini file

nano /etc/php5/fpm/php.ini

And update 'upload_max_filesize' and 'post_max_size' values

upload_max_filesize = 150M
post_max_size = 150M

Step 2: Open Nginx conf file

nano /etc/nginx/nginx.conf

In the http block, add the following line :

client_max_body_size 150m;
client_body_timeout 120;

Then to bring the changes in effect restart Nginx and PHP-FPM

service nginx restart
service php5-fpm restart
© 2022 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven INC is more than just a managed WordPress Hosting that offers more secured unlimited website hosting with it’s CDN ready worldwide Datacentres.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram