Support » Fixing WordPress » Increasing max_post_size

  • Topher


    I realize this question has been beaten to death many times, but none of the other posts I read helped me out.

    I need to increase my upload size from 1M to 10M. I’ve created a custom php.ini file and set these:

    upload_max_filesize = 10M
    post_max_size = 10M

    and then created a phpinfo page and confirmed that my php.ini file is being used AND the settings are there properly.

    Still WordPress only lets me do 1M. Is there a setting inside WordPress someplace that would over ride the settings it’s getting from php.ini?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Check inside your wp-config.php file and your .htaccess file, there’s a possibility that one of those 2 files may be interfering.



    Nope, there’s nothing there.

    I did some further checking:

    I tried printing ini_get( ‘upload_max_filesize’) in various places, and it’s always right. I eventually found the function that calculates the sizes allowed, wp_max_upload_size.

    In the top of that function I printed the ini options and they’re right. At the bottom of the function the total is calculated wrong. It’s doing

    $bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );

    Feeding in 10485760 for both $u_bytes and $p_bytes should come up with 10485760 at the other end as well, but it’s coming up with 1536000.

    What’s going on here?



    Forum Moderator

    Try contacting your hosts for assistance.



    They simply told me to make a custom php.ini file. 🙂 That’s done, and it works wonderfully. I’m wondering my WordPress isn’t doing the math right.



    Inside wp_max_upload_size(), if I set $bytes = 10485760; it lets me upload a larger file, but then says HTTP Error in red at the top and never finished crunching, so something’s obviously really set wrong, rather than simply doing the math wrong. Is there another setting besides upload_max_filesize and post_max_size that has to be set for larger uploads?

    Hmm… it’s possible that your host still has some other setting over-riding the upper limit of your php.ini file.



    I don’t think it’s that because if I print the values of both variables in the same function that calculates the total they’re both large. So the php settings are right, something inside WordPress is eating them. 🙁

    If you are in a wordpress multi site installation you‘ll have to change manually some values in site_meta table.

    They are:
    1. blog_upload_space – The amount of space a single blog has to upload files to
    2. fileupload_maxk – The largest file that may be uploaded (I believe this is in bytes)
    3. upload_filetypes – This restricts the MIME type that can be uploaded I believe through the Flash uploader

    Many thanks to Sean

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Increasing max_post_size’ is closed to new replies.