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?

Subscribe
Share

This completely broke my installation.

Broke mine as well.

You can directly make changes from the admin panel.This is the simple method i have used and help to solve most problems.

1.Download and Activate WP File Manager Plugin 2.Select .htaccess file 3.here you can change most of the commands.

Some of the commands i used and solved my several issues. They are,

php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300


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

@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.

Hello,

Hello,

You can create a php info file in order to check the current values and check which is the php.ini file in use. Create the following file in your public_hmtl folder - phpinfo.php and put the following code inside it:

<?php
phpinfo();
?>

You can also use the following command in order to find the location of the php.ini file:

php -i | grep php.ini

The output will be:

Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

Then check for the current value of uploadmaxfilesize you can also check which is the configuration file - php.ini that is currently used and apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites). Ideally you would like to have the following values:

upload_max_filesize = 64M

You also need to restart your web server in order the changes to take effect.

Hope that this helps! Regards, Alex

How I solved my Problem of the 2M upload limit:

In Wordpress the Plugin “Increase Maximum Upload File Size” showed: ‘Maximum upload file size, set by your hosting provider: 2MB’ before the fix

and

‘Maximum upload file size, set by your hosting provider: 100MB’ after the fix.

I figured out there are two “php.ini” files in the directory: /etc/php/7.3/ one under /cli and the other under /fpm. Changing the php.ini under /cli didn’t solve it, but the php.ini the /fpm folder.

I also had to edit my nginx.conf file under /etc/nginx. Add the following line to http or server or location context to increase the size limit in nginx.conf, enter: “# set client body size to 64M #” client_max_body_size 64M;

Afterwards in the console of my droplet I restartet the server using root access and the command: sudo shutdown -r now

This solved the problem. I hope it helps!

Kind regards

Chris

Everything that is explained is fine, only if they did not solve it they are changing the number in the wrong place in php.ini, here is the correct line and my changes that did work, then restart Apache before seeing these changes reflected:

; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size post_max_size = 512M

best, max-

All doesn’t seem to solve any problem.

Thanks @jtittle1 , pointing me at the nginx configuration parameters was important to me solving this!

One thing I learned, for others, was I had to increase the parameter in three separate sections, across three files. I added

client_max_body_size 200M;

to the http, location and server parts of my nginx.conf and the individual .conf files in sites-enabled (standard and ssl). whew.