How to change the PHP Upload Limit

- by

Usually your hosting package limits the amout of data you can upload to 2MB, which isn’t enough for most of us. It’s good for that 200k photo, but say you’re uploading a 4MB audio clip, a video or a large PDF, you’re stuck.

Fret not my friends, for help is at hand! Put the following code in your .htaccess file and smoke it:

php_value upload_max_filesize 100M
php_value post_max_size 100M

Instead of “100M” you can choose any limit you like, say 5M, 10M or whatever limit you like.

If you can’t find the .htaccess file, it might either be that

  • your FTP client doesn’t display hidden files; make sure that it does
  • or it doesn’t exist (in which case, create a plain text file, upload it and name it .htaccess)

If you’re having trouble, just download this file. Then simply unZIP it and upload the contents into your WordPress directory. Once it’s on the server, rename it to .htaccess and you’re done.

Good luck πŸ˜‰



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site witout any pesky ads! More details here.

23 thoughts on “How to change the PHP Upload Limit”

  1. Doesn't work for me. If I insert those lines in the dot-htaccess file, WP doesn't work at all (gives me a Bad Configuration Error). Any ideas?

    Inside the dot-htaccess file are these lines already. I put your code at the bottom (under the last # END WordPress comment):

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  2. Hi Tom,

    sorry to hear that. I'd put the php_value statements at the very top of that file.

    The current contents makes it possible for WordPress to use "pretty permalinks". If all else fails, delete everything in the .htaccss file, make the file writeable and add the php_value statements I've given you. Then go back to Settings – Permalinks in WordPress to update the rewrite structure.

    Good luck πŸ˜‰

  3. 500 Internal Server Error
    "The server encountered an internal error or misconfiguration and was unable to complete your request."

    .htaccess has full permissions (777), the two lines are right on top and I can't get to Settings – Permalinks to update the rewrite structure because I can't get to anything at all with the error.

  4. Steven,

    depending on the text editor and FTP Client you're using, the file can get screwed up.

    I've uploaded this sample .htaccess file to get you started. UnZIP it, upload it to your server, then rename it .htaccess and change the file permissions to 777 for the permalink structure. That'll eliminate any errors that may have happened during the editing of that file.

    If that doesn't work, it must be your FTP client. Make sure it's using BINARY mode when uploading files to your server.

    Hope this helps πŸ˜‰

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.