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 without any pesky ads! More details here.

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

  1. Hi Jay,
    I've tried each of the various methods you describe above to try and get the htaccess file to work, but I'm having the same trouble that Tom S describes above. I finally downloaded your sample.htaccess file and uploaded, then renamed it–but I get the same error. Hmmm. On another, separate thread elsewhere I see a similar kind of workaround being employed on the php.ini file: I tried all of those as well–I don't get the errors, but it doesn't change the 8MB maximum upload limit. This is very frustrating, as I have a client who needs to upload a large audio file and we can't do it.

  2. Tricky one. Let me see if I get this right: without any .htaccess file, all is well but your upload limit is 2MB (or the default PHP Upload Limit) correct? And when you amend the .htaccess file as I suggested or upload my sample file, all you get is a 500 internal server error, right?

    Then the only explanation that makes sense is that the FTP client is screwing it up. Or, your server does not run Apache as a web server.

    There's one other way you can add the file and the settings if you have SSH access to your server. Are you running your own server?

    I can always do this for you if you get stuck:

Leave a Comment!

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