File exceeds upload_max_filesize, despite max filesize being large enough

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

Read More

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

Related posts

2 comments

  1. 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’s functions.php:

    add_action( 'shutdown', 'wpse115322_upload_sizes', 99 );
    function wpse115322_upload_sizes() {
        $size = wp_max_upload_size();
        $kb = $size/1024;
        $mb = $size/(1024*1024);
        echo( "$kb KB / $mb MB<br />n" );
    }
    

    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 filter upload_size_limit is mentioned in the source)

  2. It was a simple typo in my phprc.

    upload_max_filesize should be 2G, not 2GB.

    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.

Comments are closed.