WordPress.org

Ready to get started?Download WordPress

Forums

Increasing max_post_size (9 posts)

  1. Topher
    Member
    Posted 2 years ago #

    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?

  2. paulhastings0
    Member
    Posted 2 years ago #

    Check inside your wp-config.php file and your .htaccess file, there's a possibility that one of those 2 files may be interfering.

  3. Topher
    Member
    Posted 2 years ago #

    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?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Try contacting your hosts for assistance.

  5. Topher
    Member
    Posted 2 years ago #

    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.

  6. Topher
    Member
    Posted 2 years ago #

    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?

  7. paulhastings0
    Member
    Posted 2 years ago #

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

  8. Topher
    Member
    Posted 2 years ago #

    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. :(

  9. mr.vasseur
    Member
    Posted 2 years ago #

    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
    http://seanklein.org/2009/06/wordpress-php-upload-information/

Topic Closed

This topic has been closed to new replies.

About this Topic