I am trying to upload a 762KB picture using the multi-file uploader at /wp-admin/media-new.php. This page reports that my maximum upload filesize is 2GB.
However, once the upload progress bar gets to 100%, the upload fails with
The uploaded file exceeds the upload_max_filesize directive in
php.ini.
I am aware of how to set my upload_max_filesize and associated variables in php.ini, but that appears to be correct. What else could be causing this?
Other potentially useful information:
- post_max_size is 3G
- max_execution_time is 600
- memory_limit is 256M
- The site is hosted on Dreamhost (shared hosting, unlimited storage).
My .phprc:
upload_max_filesize = 2GB
post_max_size = 3G
max_execution_time = 600
memory_limit = 512M
max_input_time = 500
Apparently there’s an
upload_size_limit
filter in WordPress. To check what your site’s upload limit is set to, add this to your theme’sfunctions.php
:That’ll print your site’s actual max file size at the bottom of every page. If it’s less than you anticipated, it could be that a plugin or your theme has set it low. Try disabling all plugins, then turn them on one by one till you find the culprit. If it’s not a plugin, try switching to a default theme (Twenty Ten/Eleven/Twelve/Thirteen).
Reference
wp_max_upload_size()
(The filterupload_size_limit
is mentioned in the source)It was a simple typo in my phprc.
upload_max_filesize
should be2G
, not2GB
.It’s interesting that WordPress and PHP/phpinfo() still picked it up and claimed the limit should be 2GB, though it makes perfect sense as to why uploads weren’t working correctly.