Question

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

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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Most likely you are using PHP-FPM with Nginx, so you would edit the php.ini file <br> <br>e.g. To change max file upload size to 100MB <br> <br>Edit… <br>vim /etc/php5/fpm/php.ini <br> <br>Set… <br>upload_max_filesize = 100M <br>post_max_size = 100M <br> <br>Also add following line to http{…} block in nginx config: <br> <br>http { <br> #… <br> client_max_body_size 100m; <br> #… <br>} <br> <br>Source: https://rtcamp.com/tutorials/php/increase-file-upload-size-limit/

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 upload_max_filesize . After setting the value to 100M save it clicking Ctrl O and then click Ctrl X.

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