简体   繁体   中英

Can't get php.ini's updated value

I have changed php.ini's some value in php.ini file and also through php script like,

ini_set('upload_max_filesize', '10M');
ini_set('POST_MAX_SIZE', '10MB');

but when I am running phpinfo() it doesn't shows the updated value.

It shows

upload_max_filesize = 2M

I am wondering how it is possible??

Do you have access to your Apache configuration ?

Maybe theses parameters are overridden in the virtual host of the Apache configuration via php_admin_value. If this is the case, then you won't be able to change this value in the php script itself.

Also, check the following post : Changing upload_max_filesize on PHP

Good luck with that.

Firstly, it is very common for your environment to contain several php.ini files, where the one you're editing is not actually being used. Check php_info() output for the path to the loaded configuration file to double check.

If it's definitely correct, restart your web server and double-check it's still not loading.

If you still got no luck, have a look at the return values for ini_set() :

if(ini_set('upload_max_filesize', '10M') === FALSE ||
   ini_set('POST_MAX_SIZE', '10MB') === FALSE)
{
    echo "Failed to set a configuration parameter.";
} else {
    // These functions returned strings containing the old value.
}

Let us know what the above returns for you.

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