Problems uploading large files in WordPress – the *second* php.ini setting
February 24th, 2009 by Dan YorkRecently I spent some time working on our site and making it so that I could upload large media files directly through the WordPress web interface. In doing so, I ran smack into the default limit of 2 MB on file uploads. I spent time in the WordPress support forums and found the general consensus that you needed to change the upload_max_filesize setting in your /etc/php.ini file to be larger. So I changed that setting to “100M”, restarted Apache and thought I would be all set.
However, this still didn’t let me upload larger files. In fact, the result was somewhat comical in that the WordPress error message said “You cannot upload files larger than 100M” – but yet my files were far smaller than that. It turned out in further investigation that there is a second setting in php.ini that needed to be changed: post_max_size, as in “the maximum size of a given blog post”. That was also set to “2M” and was therefore gating my upload. A quick change to make both look like:
upload_max_filesize = 100M; post_max_size = 100M;
followed by a restart of Apache… and I was uploading away. I’m writing this here mostly so that I remember for other WordPress installs – and in the hopes that it helps someone else out there…
If you found this post interesting or helpful, please consider either subscribing via RSS or following on Twitter.
Technorati Tags: wordpress
Related posts:
Tags: WordPress
If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.
RSS Feed





September 15th, 2009 at 8:06 am
Hi,
I have the same issue with my blog. But I can`t seem to find the etc/php.ini file. Could please explain in more detail as to where I could locate it on my server, and how to restart the Apache. I have a hosting account at Hostmonster. Thanks Zelimir
September 23rd, 2009 at 7:20 pm
Zelimir, Unfortunately, you are probably going to have to talk to your hosting provider to sort out exactly what you can or cannot do. On a Linux system, the php.ini file is typically found in:
/etc/php.ini
On some Linux systems I have found that there might be a “php” subdirectory in /etc/, so the file might be /etc/php/php.ini. Or something like that. But it’s something you’ll have to ask your hosting provider about. Likewise re-starting Apache is probably specific to your host. On many Linux systems you can do something like:
/etc/rc.d/init.d/httpd restart
(as the root user) Again, this will vary according to what Linux distribution you are using. Sorry I can’t be of more help, but it really is dependent upon what your hosting provider makes available to you.
Dan
October 20th, 2009 at 6:00 pm
Thanks a lot! Just got same problem.
October 21st, 2009 at 8:29 am
You are welcome. Glad the post was helpful.