Support » Networking WordPress » Max upload filesize should work but it isn't

  • Resolved salientdigital


    I have full root access to my server. I’ve changed my server’s php.ini as follows:

    memory_limit = 32M
    upload_max_filesize = 10M
    post_max_size = 12M
    file_uploads = On

    I restarted Apache.
    Still, the media library for the sites in the Multisite network all say

    Maximum upload file size: 439kb

    Any ideas why that could be? I don’t have any php_flag directives in .htaccess so I’m at a loss to figure out how this could be.

    I did a search for ini_set in the source code and found a reference to two constants, one in admin.php on line 109:

    @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );

    and another in media.php on line 253:

    @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );

    Now then, in default-constants.php, WP_MAX_MEMORY_LIMIT it set to 256M, and WP_MEMORY_LIMIT is set to 64M.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you changed the upload limit within your WordPress settings?

    I haven’t changed any WP defaults, no. Based on almost every other post online, the main way people alter the max_upload_filesize is by hacking either php_flag in .htaccess (worst way) or custom php.ini in various folders under the WP install (also a bad way). These recommendations are things to try if you can’t edit php.ini. The thing is, I’ve edited my php.ini so I’m at a loss to explain how WP could be getting a setting of 439kb.

    Where would I find this upload limit?

    Memory != filesize

    MultiSite does have a SIZE limit for uploads.

    Go to wp-admin/network/settings.php

    Look for “Site upload space”

    Woohoo! Ipstenu, you’re my hero. I had no idea that was there, and never scrolled down far enough on the Network Settings page.

    Now I get it. For anyone reading this in the future, as Ipstenu pointed out, there are two controls affecting the max upload filesize (in addition to the value in php.ini). What is reported to your WP Multisite domain’s Add Media screen is actually the smallest of these three values:

    1) Your max_upload_filesize setting in php.ini;
    2) how much actual space is left over when calculating [Site upload space] – [sum total of files already uploaded]
    3) The max upload filesize value you set in wp-admin/network/settings.php

    So in my case, with the meager default settings, all that was left after subtracting all the smaller images and stuff they already upload was 439kb. I can see this being really useful, for example, in assigning 100mb of storage to each of 10 domains in a 1GB hosting plan.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Max upload filesize should work but it isn't’ is closed to new replies.