Increase file-size limit with Wordpress-Nginx-PHP-FPM

Increase file-size limit with Wordpress-Nginx-PHP-FPM

Posted: 9 years ago in  Unix | PHP | Wordpress |


In CentOS with PHP-FPM and Nginx, to change file-size limit, the configuration differ slightly from which in Ubuntu with mod PHP for Apache (libapache2-mod-php5/php5) and Apache.


Same configuration

Add this line to wp-config.php

define('WP_MEMORY_LIMIT', '256M');

Different configuration:

For Apache + mod PHP

For Nginx + PHP-FPM

Edit virtual host file of nginx, within tag server, add in

client_max_body_size 256M;

Find php.ini file

locate php.ini

And edit/add these lines

post_max_size = 256M
upload_max_filesize = 256M