PHP info returns upload_max_filesize as 10MB for master and local. However when I try to change the upload limit for a ROLE webfm returns this:
"Your PHP settings limit the maximum file size per upload to 4194304 MB."

This appears to a bug (or I'm an idiot) because I can't find where the problem is.

Comments

IgD’s picture

Fixed:
Drupal halves the value of post_max_size
-I increased the post_max_size to double what I wanted and it worked great

robmilne’s picture

Status: Active » Closed (won't fix)

The 'bug' is in file.inc (line 724):

/**
 * Determine the maximum file upload size by querying the PHP settings.
 *
 * @return
 *   A file size limit in MB based on the PHP upload_max_filesize and post_max_size
 */
function file_upload_max_size() {
  static $max_size = -1;

  if ($max_size < 0) {
    $upload_max = parse_size(ini_get('upload_max_filesize'));
    // sanity check- a single upload should not be more than 50% the size limit of the total post
    $post_max = parse_size(ini_get('post_max_size')) / 2;
    $max_size = ($upload_max < $post_max) ? $upload_max : $post_max;
  }
  return $max_size;
}

Not sure why the core people want to cut 'post_max_size' in half, but this isn't a bug.

jrwjrw’s picture

Undocumented and aggravating. Just wasted two hours on this. Why is this administrative variable silently halved? The php.ini variable 'upload_max_filesize' is checked when this variable is set but the php value is not halved. So now I must double the php variable just to get this to work.

hedac’s picture

I have 50 MB for maximum size.. and phpinfo() says it is 50Mb... but still Webfm says "Cannot exceed 8 MB limit set in php.ini."
what is wrong?

cgmonroe’s picture

Webfm just asks the core what the max is... and that is pretty stable so I would guess it's returning the correct value.

I suspect that you are not looking at the correct ini file or this has been overridden in the .htaccess or other code somewhere.

To find the ini being used, try creating a file named php-info.php in your webserver root with the following line in it:

<?php phpinfo(); ?>

This will display a lot of info about your php set up, including the ini location and values set.

hedac’s picture

You are right... other modules like filefield.. also display 8MB...
but phpinfo() says it is 50MB... I wonder what could be wrong... but.. I don't think it is a webfm bug. thanks.