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

Posted March 15, 2014 27.8k 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
7 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

first run this command
sudo find / -name “php.ini”
then after finding the file run this command
nano /etc/php/7.0/fpm/php.ini
after you are in the file click Ctrl w to search for uploadmaxfilesize . After setting the value to 100M save it clicking Ctrl O and then click Ctrl X.