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 :

http{
....
.....
....
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
WPOven
© 2024 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven is the best Managed WordPress hosting for agencies and businesses that want to succeed. With Unlimited sites hosting option, its easy to use and manage, so you can focus on growing your business. 
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram