Reputation: 8496
I am trying to increase the value of upload_max_filesize to 10485760 (10M).
I am using:
ini_set('upload_max_filesize',10485760);
This is always returning false and the upload_max_filesize continues to be 2M. I am using php 5.2.8 on windows and I don't have the ini_set disabled and am also not with safe mode on.
Anyone know why this doesn't work? Thanks
Upvotes: 1
Views: 3028
Reputation: 1316
Check variable [post_max_size][1]
.
Sets max size of post data allowed. This setting also affects file upload.
Upvotes: 0
Reputation: 12005
is it running in apache (mod_php)? if so there are settings in apache that effect this as well.
The apache webserver has a LimitRequestBody configuration directive that restricts the size of all POST data regardless of the web scripting language in use. Some RPM installations sets limit request body to 512Kb. You will need to change this to a larger value or remove the entry altogether.
Upvotes: -1
Reputation: 99495
The upload_max_size setting will be checked before your PHP script starts running. So by the time you change the setting, the upload already failed.
Upvotes: 5
Reputation: 1687
Try editing the value in the php.ini file instead of in your PHP script. Your script may not for whatever reason have permissions to override php.ini.
Upvotes: 3