Increase max file upload size in wordpress. Using Ubuntu 12.04, + LEMP stack

March 15, 2014 13.1k views
How do I increase the max file upload size in wordpress? I'm using Ubuntu 12.04 and the LEMP stack. I think it's a PHP thing but I'm not 100% sure.
6 Answers
Most likely you are using PHP-FPM with Nginx, so you would edit the php.ini file

e.g. To change max file upload size to 100MB

vim /etc/php5/fpm/php.ini

upload_max_filesize = 100M
post_max_size = 100M

Also add following line to http{..} block in nginx config:

http {
client_max_body_size 100m;

Thanks for an awesome answer!

I think I'm using fastCGI and not PHP-FPM though. Is that likely or am I completely not understanding how the system works? I followed the LEMP stack tutorial here on Digital Ocean so whatever that installs is what I'm using. Would you mind sharing what to edit if that's the case? Also, how would I check that? Sorry for such noobish questions, trying to learn a lot really fast.
Can someone help step by step To change max file upload size

The file does not allow edit?
tried with ! too, but does not work

Am using ubuntu, how do i edit this file on my server

I think this might be useful for all of you. First run

locate php.ini

So that you can find all php.ini files no matter what you are using.
Then make all changes as needed

Have another answer? Share your knowledge.