Support » Fixing WordPress » Mismatched “post_max_size” and “upload_max_filesize” values.

  • Hello. WordPress site health status is suddenly showing this recommended improvement:

    “The settings for post_max_size and upload_max_filesize are not the same, this could cause some problems when trying to upload files.”

    I don’t even know where the settings for both are, so I have no idea how to make them the same. I’m hoping somebody here can help. Thank you.

Viewing 15 replies - 16 through 30 (of 54 total)
  • Thread Starter gorgeouskitty

    (@gorgeouskitty)

    @diondesigns @robhowells

    Hello. Thank you for all your help. Sorry I don’t have much knowledge about this so I wanted to confirm.

    In my case, post_max_size (260M) was indeed set greater than memory_limit (256M) when I looked. So it’s all right that I tampered with the php.ini to reduce post_max_size to the same value as memory_limit, right? That won’t cause any problems?

    Hey their gorgeouskitty I want to thank you for helping me solve your issue. I had the same problem you did and a Google search found your question. I called Bluehost who hosts my sites and literally 9 minutes later my problem was solved. her’es how you fix it!

    1. Log into your cPanel
    2. Under Software click the icon for Multi PHP INI Editor
    3. In the Drop Menu for Select Location choose your domain name
    4. I made both my max post size and file size 512M
    5. Click Apply
    6 Go back to your Site Health and rejoice knowing that you may have 99 problems but a PHP INI setting isn’t 1 of them any longer

    I also made that change and it worked!!!
    But it says ” Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.”
    Which means to me that the change shouldn’t be made?

    For me, making any or all of these changes did not affect the site health. This mismatch still shows up as a recommended improvement. However, I also have an active PHP session, so that is maybe affecting me? Initially my php.ini file did not specify any of this. I am making the changes with an editor using PuTTY.

    Like @diondesigns said, it’s a bug with the Site Health tool. The message appears whenever post_max_size and upload_max_filesize are not equal. But in fact the message should only appear when post_max_size is smaller than or equal to upload_max_filesize.

    For those interested, here you can read what the PHP manual has to say about the proper relative values for post_max_size, upload_max_filesize, and memory_limit: https://www.php.net/manual/en/ini.core.php#ini.post-max-size

    What it boils down to is that memory_limit should be larger than post_max_size, and post_max_size should be larger than upload_max_filesize.

    Thanks for the feedback. I must have something else going on and I will suppress my OCD until the site health tool is fixed. I don’t get many people uploading to the site anyway.

    For what it’s worth, here is where I went wrong: the cPanel settings to which @darkwatergroup11 refers overrides whatever you place manually in the php.ini file. Setting limits within the php.ini file has no effect. Making the changes in cPanel as he says fixes the site health recommended improvement. Thanks everyone.

    Thread Starter gorgeouskitty

    (@gorgeouskitty)

    @darkwatergroup11

    Yes, that’s exactly how I did it, except I used 256M instead of 512M.

    Originally, I found that both memory_limit and upload_max_size were at 256M, but post_max_size was 260M. I merely changed post_max_size to 256M so it wouldn’t be greater than the memory_limit. 🙂

    And what if, like in my case, both values are exactly the same but WP still shows that warning in the Site Health section. I have checked my configuration in my server’s panel and both are stated as 25M

    Thanks!

    Thanks to all of you for this useful discussion. I’m having a similar problem.
    So I went to MultiPHP INI Editor, and found the following…

      MEMORY LIMIT 25600M
      post_max_size 26000M
      upload_max_filesize 25600G [G not M]

    Yes, that’s right G not M. Does G stand for GB and M for MB? If so, I’ve got a big mismatch. This maybe started when I couldn’t upload a 2.2 MB file and I asked the Bluehost rep to help. (They don’t always know what they are doing.) S/He assured me it was now big and I could upload any file.
    So should I set it all to 25600M?
    Can I make it bigger if I want?
    Can I make these settings as big as I like.

    • This reply was modified 10 months, 1 week ago by mnatseah624.

    I see one person writing that they changed them both to 2560M and another writing that they set them both to 25M.
    I don’t know where they got those values from but I changed them both to 256M and the health warning concerning this disappeared.
    However, I am still confused about the notation saying “Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.” if true, brings back the site health error again.

    Interesting. So…
    Do G and M mean GB and MB
    Should memory_limit be bigger than the other settings?
    Can I make these settings as big as I like?

    It appears you can make the setting as big as you like. whether or not it will work is another story. The guy I spoke to at Bluehost had a great point when I asked him that same question: Do you think you’d ever need more than 512? Try it out whatever size you want to see if it works. If it doesn’t work you know that 512 does.

    Cheers

    @gorgeouskitty I did what you did and its fixed now! You can close.

    No, you cannot!

    Could @spartelfant or any other with knowledge let me know why I have the warning even with the same number (25M) in both values?

    Sorry for insisting, but I don’t want my message getting buried under other comments not directly related to this issue.

    Thanks again!

Viewing 15 replies - 16 through 30 (of 54 total)
  • The topic ‘Mismatched “post_max_size” and “upload_max_filesize” values.’ is closed to new replies.