SvennD
June 17, 2018

Increase upload size for Nginx, php-fpm and WordPress

Posted on June 17, 2018  •  1 minutes  • 136 words  •  Suggest Changes

In order to increase the size of files you can upload in WordPress, we need to adapt the software powering the software.

Let’s begin with PHP, I use Nginx + php-fpm to run PHP, so I need to edit

/etc/php.ini

on line 799, _upload_max_filesize _determines the maximum allowed size a PHP file will accept for upload.

upload_max_filesize = 2M

This should not be to big, but a few megabytes will work just fine. I increased this to 10M (~10MB)

After that its time to update Nginx to allow larger upload body’s, this I already had an error documented in the past. So in short :

/etc/nginx/nginx.conf

add after the

http {

# increase upload size to 10MB
client_max_body_size 10M;

Once that is done, just restart Nginx and php-fpm.

systemctl restart nginx
systemctl restart php-fpm

And voila

Support

If you enjoyed this website, consider buying me a Dr. Pepper

Buy me a Dr PepperBuy me a Dr Pepper