Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase max upload file size WordPress multisite

I'm trying to increase the max file size for a WordPress multisite install (currently 1MB). I've tried a number of things to no avail. The things I've tried:

Adding these to my hosts php.ini file:

memory_limit = 300M
post_max_size = 32M
upload_max_filesize = 32M

Adding these to the functions.php file in the theme:

@ini_set('upload_max_size' , '32M');
@ini_set('post_max_size', '32M');
@ini_set('max_execution_time', '300');

Adding these to the .htaccess file:

php_value upload_max_filesize 32M
php_value post_max_size 32M

I even tried checking the wp-includes/default-constants.php.

Interestingly, I have another WordPress install (not multisite) on the same server that seems to work perfectly (max upload there is 32MB). Any ideas what to try next?

Thank you.

like image 949
Phil Avatar asked Dec 09 '13 15:12

Phil


2 Answers

Figured it out. In all my infinite wisdom, I completely missed the "Max upload file size" setting in Network Admin > Settings > Network Settings. It's right near the bottom of the page.

like image 63
Phil Avatar answered Oct 20 '22 00:10

Phil


@Allpnay posted the solution, just paste on functions.php:

add_filter( 'upload_size_limit', 'PBP_increase_upload' );
function PBP_increase_upload( $bytes )
{
  return 1048576; // 1 megabyte
}

In my case want 8mb so change for return 8000000; // 8 megabyte

like image 43
Beatscissors Avatar answered Oct 20 '22 00:10

Beatscissors