This was a minor odyssey - I’m trying to import a Wordpress Export/XML file to this blog, yet the file size of 2.8MB exceeds the built-in limit of 2MB. Apparently this was included as a bandwidth hedge for hosters of some kind.
Judging by the amount of Google hits on “upload_max_filesize wordpress” it’s apparent this isn’t a simple fix.
In any case, the answers start with “Change your php.ini file” followed with “if that doesn’t work, change your .htaccess file”. The latter is often suggested as some hosters don’t allow you to edit php.ini. Mine (BlueHost) does, as confirmed via a quick live support chat tonight.
So great, I can edit php.ini - and I need to change this line:
upload_max_filesize = 2M
to
upload_max_filesize = 10M
or whatever your desired max upload file size is. “M” = Megs. You also need to add, right below the above, on its own line:
post_max_size = 20M
Again, edit the # to whatever you need, though it apparently needs to be larger than the upload_max_filesize #.
But I have several php.ini files, and none seem to make the change work!
Ah, so the clincher in a Wordpress install, for me at least - WHICH php.ini file needs to be edited? You may have several -> at your www root, inside your WP install, etc. In my quest, it turns out NONE worked - but the help text from my hoster included in the php.ini file (any of them - all were the same) noted that I needed to copy over a php.ini file into whatever folder held my upload script, aka “upload.php”.
In Wordpress, that means wp-admin folder. So the solution, in short:
- Confirm you can in fact access/edit your php.ini files. Assuming yes (if no, go see this article referencing the .htaccess bit), then
- Copy/duplicate the php.ini file that sits in your Wordpress install’s root folder.
- Move the copy to wp-admin
- Rename it back to php.ini
- Add in the above code
- Save
No guarantees whatsoever, but it worked for me! If you are all all nervous about playing with some of your core Wordpress or hoster files, I’d probably hop over to your hoster’s support forums first.













{ 3 trackbacks }
{ 25 comments… read them below or add one }
You, sir, have saved my bacon from the wrath of my Irish priest with this advice! (Okay, I’m kidding about wrath…kinda. Heh.) I’m moving our parish website over to WordPress forced into a static page kinda configuration, and it seemed like there was no way on this Earth that I was going to be able to HTTP our audio sermons to the site. It never occurred to me that upload.php was the active file in all of this for some reason.
All of this to say that you rawk and I get to make Father happy. The world is well. Thanks so much!! :-)
@Infinitely - haha, glad I could help. :) That’s why I wrote this, as I figured if it took me 10 hours or so of painful hunting online, others must be in the same boat.
Great!. It worked for me too. I copied php.ini file to wordpress admin folder and problem solved.
Thank you Kevin.
Thanks! it really did the magic!
I can’t believe… it’s works really fine !!! php.ini has been copied to the WP-ADMIN and it works fine !!!
what a stupid bug !!!
this is what i do after getting advice from my webhosting..
create php.ini file. In it, put this :-
[PHP]
upload_max_filesize = 9M
max_post_size = 9M
then upload this file to wp-admin. Its working fine with me…
Thank you so much.
My root PHP ini file (on BlueHost) was named “php.ini.default,” so I downloaded to my desktop changed the settings to “upload_max_filesize = 100M” and “max_post_size = 100M” and then renamed the file “php.ini” and uploaded to the WP admin folder and it works great!
THANK YOU!
Thank you so much. The Bluehost comment from Renee above worked perfectly for me too. The key was renaming the file to php.ini and putting it in the wp_admin directory.
Thanks so much for the help!!!
Thanks great but i couldnt find the file, eventually got it:
Can’t find the php.ini file on your server ?
this will help blue host users find the file.
http://helpdesk.bluehost.com/kb/index.php?mod_id=2&id=145&kb_rating=yes
This was very helpful. I was trying to upload a video to my site, and once I found out that the php.ini file needed to be in my wp-admin folder, my video uploaded fine. Unfortunately, even though I can now upload my video, for some reason Wordpress won’t display the video in my post. I can get it to display a link to the video, it won’t embed the video in my post. Any suggestions?
Thanks,
Yes! The /wp-admin folder, that’s the ticket. I can’t believe that this tip is not easier to find. I don’t doubt you spending 10 hours hunting for the solution. Came to your post through this thread on the Wordpress support forum after a good while myself: http://wordpress.org/support/topic/165450 . Thanks for your detective work!
Ross, Lance, Daphne, Marc, etc - glad this post helped!
@Lance - I’m certainly not an expert, but I think the issue is you are just trying to link to a file (the video) you uploaded, instead of to a stream of that video like you’ll find on YouTube. To get it to stream, I’m sure there are ways to DIY, but I would probably just go get an account on Vimeo (my favorite) or YouTube, upload the vid, and then just embed back to your blog post.
Kevin,
As an Oregon State Grad it is difficult for me to say this, but here it goes . . . .
“There is at least one Oregon grad that contributes to the world.” Thanks man, you saved me hours. I appreciate it tremendously.
John
dude you saved me, i’ve been trying to get this thing working, but somehow i didn’t know i have to paste that into my admin root as well.
cheers.
Does one have to rename it in the root directory as well?
What I mean is does one have to rename the original php file as well? Sorry, all the technicalities are a bit beyond me
Hi ra:
Yes, the file has to be named “php.ini” and live in your blog’s root directory. Keep in mind I haven’t tried this again since I wrote this post 9 months ago, so things may have changed. But back then, yes, the file in your root had to be named php.ini.
Hope that helps!
Kevin
THANK YOU!!! I was about to go insane after hours of hunting and tweaking without effect. This did, thanks so much.
OK, I’m having a problem. I set my upload_max_filesize to 20M (was 2M) and added a value for max_post_size = 20 M.
I renamed the file php.ini and put it in my public_html folder, and also in the wp-admin folder of this particular install of Wordpress.
In the Wordpress dashboard, I go to “Upload New Media” and submit a file. It says, “The file is too big. Your php.ini upload_max_filesize is 20M”. The file is not even 9 megabytes.
What am I doing wrong?
thank u!!!!!!!!! now I can upoload my videos to my space in bluehost!!!!
I had the hardest time getting mine to work. I edited the php.ini file what seemed like a thousand times and it did not work. I finally named it php5.ini (since I have a godaddy host on php5) and it magically worked! THanks!
Copy what cyber6 wrote. Paste into word pad. change file and post size values to what you want. Save as php.ini Upload to root directory, and voila! It works! Thanks a bunch, I’m done and haven’t even gotten a response to my ticket yet…
Thanks alot..this saved me!
Thanks buddy!! It worked.