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.






22 Comments
I just upped the memory limit on the linked php.ini file to 64MB. One of my sites was getting the error: “allowed memory size of 33554432 bytes exhausted”.
hi,
i think it is not a good idea to change directly to php.ini file. rather we can use ini_set() function to set php.ini directive.
thanks,
tahsin hasan.
agree with @tahsin hasan
Thanks for your help! Quick fix was just what I needed to be able to run some tests. :)
@tashin @Mr.Hyd
Didn’t get your point
Hello Devin,
I downloaded you PHP file and uploaded it to wp-admin but i’m still getting the same error when importing my posts. THanks!
Are you using BlueHost? You may also need to upload the php.ini file into the root directory of your site (see step 6). Let us know if it works after that.
Hi there,
I’m using justhost.com and uploaded your php.ini file into the wp-admin and public_html folders through cPanel (because I couldn’t locate one or create one through cPanel).
I attempted to upload a 15MB file – initially I was getting the ‘max size 8MB’ error. The upload got to 100% then went to the ‘crunching’ phase and stopped with an ‘HTTP error’.
Any ideas?
@Devin
I think you should not overlook some comments
UPDATE:
I just contacted JustHost via their live chat and they told me that it is ‘Company Policy’ to only allow a max file upload limit of 10MB.
Damn, I guess I’m going to have to always use FTP to handle larger files.
I’m not sure how this is going to work with adding new media files to WordPress??
Hey Jeff. That’s too bad. Try using the WP Easy Uploader plug-in.
I haven’t been able to use the ini_set() with any success on BlueHost. If anyone else has been able to have this work, please post your steps.
Thanks a lot man! This really helped instead of me creating an entire new php. i loaded it up into my wp-admin for a site i was working on and it didn’t give me any exceeded limit probs. kudos :)
Thank you! After a long search, placing your php.ini file in my wp-admin folder was the simple solution to beating the 8mb upload limit I had run up against.
Much appreciated.
Thank you! After a long search, placing your php.ini file in my wp-admin folder was the simple solution to beating the 8mb upload limit I had run up against.
Much appreciated.
I’ve been trying to upload a 25-MB pdf file to the media library of my blog: http://ricehoppers.net but to no avail. I am hosted by Justhost. How can I increase the media upload limit to be able to upload a large file like a 25-MB pdf file of a book.
Thanks for your help.
Did these instructions not work for you? If not, you should call your host and explain the issue.
This worked marvelously for my real estate website, hosted by 1and1.com, when uploading a 4mb file. Thanks for this post!
Thanks for that php.ini file. It worked brilliantly for importing my WordPress data!
thanks that solved my issues. i had a php.ini files installed in my root directory but not in my wp-admin. it worked after i changed the file and also uploaded it to the wp-admin folder
Hi everybody,
I am with dreamhost and they did the same to me as well, even though I have a VPS with unlimited webspace, unlimited bandwidth per month and 1.5GB ram allocated to my account they wont allow me to change the php.ini file to suite. The only way to get access to the php.ini file is to use ssh access which I am not familiar with. I tried uploading your php.ini file into my wp_admin folder with no success, the limit is still set to 8MB even though I have changed the upload and post size limit to 150 MB, any help appreciated. I bet this question is definitely getting old over here with you guys.
hey! thanks for this post I finally solved my client’s problem. :) Thanks!