The default upload file size for WordPress is 2 MB, which is a problem if you want to upload a large media files. If you get this error, “The uploaded file exceeds the upload_max_filesize directive in php.ini”, follow these steps:
- Locate the php.ini file inside the wp-admin directory (if you can’t find this file see notes below)
- Find this line in the php.ini file “upload_max_filesize = 2M” and replace it with a higher value (e.g. “upload_max_filesize = 64M”)
- You may also want to increase your max post size. Look for this line in your php.ini file “post_max_size” and increase it as well.
- Save the changes to the file inside your wp-admin directory.
- Try the upload again
- If you still have issues, look for this file in your root directory and make the same changes.
If you don’t have a php.ini file in your directory, you can usually generate one from the control panels of your host. BlueHost has the steps listed to generate a php.ini file.
If you don’t have a php.ini file in your directory and aren’t sure where to get one (or want to see where I made the changes in the code), you can download my php.ini file. I have already increased the upload_max_filesize and the post_max_size to 64M. Once this file is copied into your wp-admin folder, the problem should be solved.
Use a Plugin
Apparently the Memory Bump can do this all for you. I haven’t tried it yet, so feedback would be appreciated.
A Comment From a User
Someone left additional instructions below in the comments. I thought they were hilarious (and accurate) so I moved them up here:
@ Anyone who knows enough about their hosted files to be dangerous (ie: you crash and uncrash your site with the click of a mouse on a daily basis goofing with it), but need baby steps to do this, here goes…
First, copy the text from the developer’s PHP file listed above. (yeah, it’s long…copy all of it….no, don’t change anything. Heck, don’t even read his notes if you get intimidated easily. Really, it’s cool….just copy it as is…)
- Get into your files via however you do it on your host (FTP, CPanel, Legacy File Manager, whatever).
- Navigate to wp-admin folder. Scroll down to see if you have a php.ini file in there. I didn’t, and if you didn’t add one at some point, yours wont either.
- I have CPanel access, so in CPanel’s file manager, click on ‘new file’. Name it php.ini. Save it. Now, find it and check box the file name. click ‘edit’. scroll down through the ‘blah blah’ about encoding. leave the default encoding selection. click ‘edit’. a blank screen will open. right click in the box and paste the developer’s code. Click ‘save’. (if you use something else other than CPanel, adjust as necessary….for FTP, create this all in notepad on your ‘puter, name it php.ini and upload to the wp-admin folder via your fave FTP program….)
- Go to your wp admin panel. navigate to ‘media’. click ‘add’. voila, your new ‘limit’ will read ’64MB’. Upload something big and hold your breath. Voila….if your host doesn’t have some imposed limit, your file should be there ready to edit!
- IF you messed up somehow and your site breaks, don’t freak out. Just go remove the php.ini file (either by deleting it or by renaming it so it doesn’t get read). Chances are you didn’t ‘select all’ and paste it right. Start over by deleting the text from the php.ini file you just created. re-copy the developer’s text and paste it again. Give it another whirl…
PS: I use GreenGeeks hosting.
PSS: If you have no clue how to access your files on your server you’ll need to befriend a minor geek to complete this fix as you can’t just click a button in your WP admin panel and get it done. You must go play with the files :-)
the Memory Bump plugin has nothing to do with this topic it is only a help for installing wp 3.0 if you have errors.
Pingback: Armando's Work and Stuff · Maximum Upload File Size
For reference, this no longer works on a more up-to-date install.
Can anyone else verify this? Matt, did you find a different solution?
Yes, all the newer installs have it at 64mb.
Verified that this no longer works on newer WordPress installations. Tested it on 3.2.1 without success. :(
Ya, its also not working for me on latest stable version of wp.
Could you get a new way?
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
http://seanklein.org/2009/06/wordpress-php-upload-information/
Thanks that worked for me. I had uploaded your php.ini file and now I can upload 1000 MB files :)
(bow)
I found nothing in this article to be true. There’s no PHP.INI file, using yours still does not work.
Uploading a simple *.wmv to be displayed on a simple WP theme has turned a 10 minute job into a two and a half hour job. “.htaccess” file manipulation is also a waste of my time.
I’ll try the Memory Bump thing, but I have my doubts.
Moving right along…
May not work with all hosts. Good luck.
If you are on wordpress multisite It won’t have effect till you made the changes I described earlier on the database. But devin is true it could just depend of your host.
Good luck
Looks like BlueHost does not allow major over rides of max file size:
http://www.bluehostforum.com/showthread.php?662-Command-To-Restart-Apache
I am 10 mb max
thanx man….. it worked for me….
Hey thanks for that, it kinda works. I copied your code into my new file called php.ini but now I have the problem that anytime I save a post or page I get the white screen.
if I delete the url down to http://www.mysite.co.uk/wp-admin/ then I can get back in but it happens every time. Do you have any ideas on this one?