PHP Upload Size variables for Admin & Non-Admin

SYSTEM INFORMATION
OS type and version Debian Linux 12
Virtualmin version 7.50.0 Professional

I had been modifying the upload limits for my servers using the following command line command:

virtualmin modify-php-ini --all-domains --ini-name post_max_size --ini-value 32M

But when I check in PHP’s config files (and my sites), I see there are still some items limited to 16M:

php_admin_value[post_max_size] = 16M
php_admin_value[upload_max_filesize] = 16M
php_value[post_max_size] = 32M
php_value[upload_max_filesize] = 32M

What’s the proper virtualmin command to modify the Admin settings as well?

Any word on this? Or should I open a ticket?

Hello!

Thanks for reaching out, and sorry for the late reply. I missed your original message.

No, it wasn’t possible before—now it is. Now you can use --fpm-admin-value to force the admin value to be written, or --fpm-value to force the user-level value to be written. If not set, it will default to existing logic, meaning it will preserve whichever value type exists.

You can use the following patch to make it work now:

webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/5352ba0

Thank you - this is why I like Virtualmin!

It’s not urgent that I do this now (the values are already set) - I can wait for the next release to come out, and test it then.

1 Like

What’s the full command / context for this, if I wanted to change the value across all domains on my server?

For all domains, use the --all-domains flag. Use --fpm-admin-value to enforce the admin flag, --fpm-value to enforce the user flag; or set none to change whatever currently exists on the config or add a user value by default.

That does not answer what I am looking for - where does the --fpm-admin-value go (or what does it replace) in my example? I am not sure of the parameters surrounding --fpm-admin-value to make it work.

root@virtualmin:~# virtualmin modify-php-ini --all-domains --fpm-admin-value post_max_size --ini-value 32M
Unknown parameter post_max_size

Changes PHP variables for some or all domains.

virtualmin modify-php-ini --domain name | --user name | --all-domains
[–php-version number]
<–ini-name name>+ <–ini-value value>+
root@virtualmin:~#

First of all, you’re missing on --ini-name param in your example.

--fpm-admin-value and --fpm-value are not values, those are the flags. It’s clearly described in the patch:

When updating PHP-FPM configuration, the --fpm-admin-value flag can be used to force a setting to be written as an admin-level directive (i.e. php_admin_value), and the --fpm-value flag can be used to force a regular user-level directive (i.e. php_value). If neither flag is given, the existing directive type is preserved where possible.

So it’s an addition to the existing command, it does not replace one of the other values?

virtualmin modify-php-ini --all-domains --ini-name post_max_size --ini-value 32M --fpm-admin-value

If this isn’t correct, I’d ask you give a full example of a valid command. I’m missing a basic concept somewhere, and without the surrounding context of what the flag is flagging, I don’t know what it is.

Correct!

virtualmin modify-php-ini --all-domains --ini-name post_max_size --ini-value 32M --fpm-admin-value

When you run the command above, it will always add to the FPM pool:

php_admin_value[post_max_size] = 32M

If you run:

virtualmin modify-php-ini --all-domains --ini-name post_max_size --ini-value 32M --fpm-value

It will always add:

php_value[post_max_size] = 32M

If you run command as before the patch, without using new flags, i.e:

virtualmin modify-php-ini --all-domains --ini-name post_max_size --ini-value 32M

It will only update php_value[post_max_size] even if php_admin_value[post_max_size] also exists. If post_max_size doesn’t exist at all it will still add php_value[post_max_size]. If php_value[post_max_size] doesn’t exist but php_admin_value[post_max_size] does, then it will still only set php_value[post_max_size] and not php_admin_value[post_max_size].

These new flags let you enforce the type, that’s all.

OK, got it! Thank you for the example, that makes sense to me now!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.