Question

Increase max filesize for Wordpress files (one click installation)

I want to upload a 50 MB File to my one click wordpress installation.

Wordpress cries that its too big a filesize.

Where are the configurations files I need to edit to set the filesize to mazbe a 100 MB?

Show comments

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.

@Sternenfisch

To help speed things up, I deployed Apache2 + PHP 7.0 on a fresh Droplet.

PHP’s php.ini file is located here /etc/php/7.0/apache2/php.ini. Depending on your PHP version, you may need to change that to 5.6 or 7.1.

When editing that file:

nano /etc/php/7.0/apache2/php.ini

And setting:

post_maxsize = 96M

and

upload_max_size = 64M

Then restarting Apache2:

service apache2 restart

The settings are showing as updated as they should be.

This can be confirmed by using:

<?php

$pms = ini_get('post_max_size');
$ums = ini_get('upload_max_filesize');

echo '<pre style="line-height: 2rem;">';
echo '<strong>post_max_size</strong>: ' . $pms;
echo '<br>';
echo '<strong>upload_max_size</strong>: ' . $ums;
echo '</pre>';

The configuration files are at /etc/php/7.0/apache2

@Sternenfisch

WordPress relies on your PHP configuration, so if PHP isn’t configured to allow uploads of that size, WordPress will throw an error.

You’ll want to modify your PHP’s php.ini file and change:

upload_max_filesize

and

post_max_size

The defaults are 2MB and 8MB, so we can adjust those to something higher for your needs. I’d set them as:

upload_max_size = 64M

and

post_max_size = 96M

If you’re using NGINX instead of Apache, there’s a variable in NGINX’s main configuration file that you may also need to change as it also limits the size of uploads, that’d be:

client_max_body_size

You’d need to define that and set it to 64M as well.

client_max_body_size 64m;

You’d then restart Apache, or restart both NGINX and PHP-FPM. It just depends on which you’re using.