• Ogggeee

    (@ogggeee)


    I think I have tried everything. On a single site I had 64MB upload limit but not on the multisite. Was 1MB when I installed multisite but then i changed the Max upload file size in Network admin -> Settings -> Network Settings to 64mb (65536 KB). However It only went up to 2MB file upload limit. “Maximum upload file size: 2MB.” from “Maximum upload file size: 1MB.” I then started editing code but nothing seems to work.

    default-constants.php:

    function wp_initial_constants( ) {
    	global $blog_id;
    
    	// set memory limits
    	if ( !defined('WP_MEMORY_LIMIT') ) {
    		if( is_multisite() ) {
    			define('WP_MEMORY_LIMIT', '64M');
    		} else {
    			define('WP_MEMORY_LIMIT', '40M');
    		}
    	}
    
    	if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
    		define( 'WP_MAX_MEMORY_LIMIT', '256M' );
    	}

    template.php:

    function wp_import_upload_form( $action ) {
    	$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    	$size = wp_convert_bytes_to_hr( $bytes );
    	$upload_dir = wp_upload_dir();
    	if ( ! empty( $upload_dir['error'] ) ) :
    		?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
    		<p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
    	else :
    ?>

    .htaccess:

    <IfModule mod_php5.c>
    php_value post_max_size           10M
    php_value upload_max_filesize     64M
    php_value memory_limit            500M
    </IfModule>

    wp-config.php:

    define('WP_MEMORY_LIMIT' , '64M');

    php.ini:

    upload_max_filesize = 64M
    post_max_size = 64M

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    You don’t have to mess with Memory Limit. that’s totally separate.

    Please revert back default-constants.php and template.php before messing with anything else.

    Are you sure you’re allowed to change those settings in php.ini?

    Did you figure this out? I’m having the same issues.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite 2MB file upload limit. Tried everything I could find.’ is closed to new replies.