简体   繁体   中英

upload_max_filesize not changing

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

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.

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.

尝试这个:

ini_set('upload_max_filesize','100M');

Check variable [post_max_size][1] .

Sets max size of post data allowed. This setting also affects file upload.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM