Your PHP settings limit the maximum file size per upload to 4 MB.

venkateshg - February 25, 2008 - 08:59

Hi,
I tried to change settings for upload file, but i am getting this error -

Your PHP settings limit the maximum file size per upload to 4 MB.
Depending on your sever environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.

Even i made changes to php.ini, settings.php and .htaccess file
I made changes like this

in php.ini
upload_max_filesize=10M

in settings.php

ini_set('post_max_size', 100000);
ini_set('upload_max_filesize', 100000);

in .htaccess

php_value post_max_size 10M
php_value upload_max_filesize 10M

i don't know what should i do now.

I know that when making

Xano - February 25, 2008 - 09:47

I know that when making changes to httpd.conf Apache should be restarted. Perhaps it needs to be restarted when making changes to the PHP settings as well?

i got changed

venkateshg - February 25, 2008 - 10:00

Hi Xano,
Thanks for your reply.
I restarted the apache, but there is no any change in it

Who do you host with?

Sverre - February 25, 2008 - 09:47

Hi Venkateshg,
It is possible that your hosting provider has limited this. Have you approached them?
Regards,
Sverre :-)
--
Sverre Sverresonn
Group Scout Leader
21st Medway Scouts, Kent, UK
http://www.21stmedway.org.uk/

Doubt hosting provider`

venkateshg - February 25, 2008 - 10:06

Hi Sverre,
Thanks for your reply,
Actually the site is configured by me.
i dont have possibility for approaching the hosting provider.
Is there any other way to do this....

Regards,
- Venkatesh

Another php.ini

Sverre - February 26, 2008 - 09:20

In php.ini try looking for "post_max_size":

post_max_size = 10M

Regards,
Sverre :-)
--
Sverre Sverresonn
Group Scout Leader
21st Medway Scouts, Kent, UK
http://www.21stmedway.org.uk/

post_max_size is divided by 2

leop - February 26, 2008 - 21:40

In the Drupal API I find that post_max_size is divided by 2, as sanity check. It says it does it only for 4.7, but when I look at the 5.7 code that is installed at my website, it still uses the divide by 2 factor:

<?php
// sanity check- a single upload should not be more than 50% the size limit of the total post
   
$post_max = _file_convert_to_mb(ini_get('post_max_size')) / 2;
?>

this may be good for users,

maulwuff - June 24, 2008 - 18:27

this may be good for users, but not for admins without this note. it produces unnecessary headaches. :(

Thank YOU!!

lsabug - March 2, 2009 - 17:45

I was tinkering with my setup and found this post and yay, it worked for 5.7. Many thanks for the info!

PHPinfo

Quint - February 27, 2008 - 16:45

What does PHPinfo say about the upload limit?

Did you change it

crusty_collins - March 20, 2008 - 20:23

in Home › Administer › Site configuration
File uploads?

This one burned me today.

me too

UnicornSong - May 29, 2008 - 00:48

I also have this problem. I have set all 3 php.ini files on my dev machine to be
post_max_size = 100M
upload_max_filesize = 1000M

phpinfo.php on xammp shows
post_max_size 100M 100M
upload_max_filesize 1000M 1000M

but in File Uploads when i try to set the Default maximum file size per upload i receive the following message within drupal

# Your PHP settings limit the maximum file size per upload to 50 MB.
Depending on your sever environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.
# Your PHP settings limit the maximum file size per upload to 50 MB.

these values are not set in htaccess or setting.php

Im just quietly going mad here. I began on this path while trying to resolve an error when trying to upload a large (dimensions) but small (filesize) image and received this error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9928 bytes) in C:\xampp\htdocs\drupal-5.7\includes\image.inc on line 326

but thats a whole other issue......

ahhhhh

UnicornSong - May 29, 2008 - 00:52

looks like i got caught by the drupal "divide by 2 sanity check"

Forget my last comment, now i can move on to the original problem

what is this sanity check

scottm316 - August 7, 2008 - 18:23

I may need one. I got the following message after changing upload settings for a role under admin/settings/upload:

Your PHP settings limit the maximum file size per upload to 50 MB.

In my php.ini I have set: upload_max_filesize = 100M

see this post

UnicornSong - September 2, 2008 - 00:36

http://drupal.org/node/109994#comment-747856
This is still in force for 5.x

 
 

Drupal is a registered trademark of Dries Buytaert.