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. Some hosts won’t allow you to override this, however it should not cause an internal server error.

    Some FTP clients screw this file up when you upload it, you can test this by downloading the file again and having a look in your text editor. It could also be your text editor – make sure you DO NOT USE Word or Pages for this, it has to be Notepad, Write or Text Edit. Your FTP client needs to transfer this file in ASCII.

  2. Yes, I followed the same instructions, but got the following when I tried to load my website:

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@joewhitenoise.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    Any thoughts?

    best,
    Joe

  3. I’m afraid not Joe,

    other that what I’ve already said in a previous comment. Some hosts don’t allow .htaccess overrides so that could be an issue. And make sure that your FTP client uploads the file correctly (you can check by downloading the file again and comparing it to the text file). Also, don’t use Word or Pages to edit the file – it has to be a plain text editor (like Notepad under Windows or Text Edit in Mac).

    I’d say get in touch with your hosting company and ask them to be 100% sure.

  4. Thanks, Jay. I’m a bit confused as to why such a limit would be imposed. I’m using WordPress through a hosting service with unlimited (theoretically) memory. I basically just want the option of embedding MP3 and video files without having to link to something like Soundcloud (whose visual interface I don’t like.)

    Any other options for how to get around this 8 mb limit?

    best,
    Joe

Leave a Comment!

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