20140619 wordpress upload size limits - plembo/onemoretech GitHub Wiki

title: WordPress upload size limits link: https://onemoretech.wordpress.com/2014/06/19/wordpress-upload-size-limits/ author: phil2nc description: post_id: 7906 created: 2014/06/19 10:56:04 created_gmt: 2014/06/19 14:56:04 comment_status: closed post_name: wordpress-upload-size-limits status: publish post_type: post

WordPress upload size limits

Out of the box, WordPress limits uploads (like media files) to no more than 2M. This limit can also be affected by a couple of parameters in /etc/php.ini as well. Details follow.

That 2M is actually turns out to be less something less than a full 2M due to the math around file size calculations (there are just 8 bits to a byte, not 10). The following discussion presupposes an enterprise environment where the infrastructure team (quite rightly) has not turned complete control over the web server to the WordPress admins.

To increase that limit you have to of course go into the WordPress admin dashboard (for multisite instances this would be the Network Admin dash) and increase the value under General (or for multisite, Network) Settings across from "Max upload file size". For example, for roughly 32M you'd enter 32000 KB.

Once that's done you'll probably also need to modify two settings in the server's /etc/php.ini and do a reload of (using the command "service reload httpd", rather than a complete restart) the web server configuration. The two parameters to modify in php.ini are post_max_size and upload_max_filesize, usually expressed in megabytes.

So:

post_maz_size = 32M
upload_max_filesize = 32M

You should also check memory_limit in php.ini to make sure it is well above what you set the above two parameters (on some servers I run this might be as high as 256M depending upon the applications being served).

To effect the latter two changes you do not need to bounce the web server. A reload (service httpd reload or systemctl reload httpd) will do the trick nicely (and minimize disrupting user access to the server).

Most of the advice you'll see out on the Internet, including the WordPress.org site, will provide various solutions that try modifying these parameters through an .htaccess or internal WordPress environment file. Those won't work, of course, if the server admin hasn't given WP permission to totally alter the those sorts of things in the web server configuration (which they're not as likely to do as your average host provider).

Copyright 2004-2019 Phil Lembo