Hi all. I followed the digitalocean tutorials for installing the core ubuntu 20.4 server, then installed lamp stack with apache2 and mysql to serve up Wordpress. I would like to change the max file upload size in php so I can upload bigger files. I’ve tried to do this where info.php points me to which is the php.ini file in /etc/php/7.4/apache2. Now the file says this:
Maximum allowed size for uploaded files:
; http://php.net/upload-max-filesize upload_max_filesize = 32M
I also created an info.php file to see where the core configuration files are coming from and its here. yet when I try to upload a file bigger than 2m in WordPress, I get an error that the max file size is 2mb and I cannot upload the file. These are smaller images I wish to test on a development WordPress install. The image is 4mb in size. the info.php file says this:
upload_max_filesize 2M 2M
Now I am not sure where this value is coming from since I edited the php.ini file that the info.php declares. I’ve tried a few other methods and even a plugin for Wordpress but this limitation has me stymied. I’ve done this countless times in the past on ubuntu and it just worked with a restart of apache2. I also rebooted the server just to make sure it’s okay.
Any pointers on where to look to adjust this 2m to 32mb for my testing and development work?
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!
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.
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.
Click below to sign up and get $100 of credit to try our products over 60 days!