WordPress.org

Ready to get started?Download WordPress

Forums

Multisite 2MB file upload limit. Tried everything I could find. (3 posts)

  1. Ogggeee
    Member
    Posted 1 year ago #

    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
  2. 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?

  3. segovia
    Member
    Posted 10 months ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic