Virtualmin modify-php-ini - Some clarification needed

OS type and version Ubuntu Linux 22.04.4
Webmin version 2.111
Usermin version 2.010
Virtualmin version 7.10.0
Theme version 21.10
Package updates All installed packages are up to date

The backgrpound

I have several PHP versions installed and I wanted to on mass update the disable_functions to my new value for each version. So I looked into running updates from the command line and came up with the following command:

virtualmin --all-domains --modify-php-ini --ini-name disable_functions --ini-value putyournewvqalueshere

What i think the command does

  • only updates php.ini in each virtual server which means this command is only good for mod_php


  • Is it correct this command is only any good if you have mod_php installed and running?
  • Can this script be altered to allow updating of the global php.ini files?
  • have I missed something simple :smile:


doesn’t look like you ideas are right and the command line is totally wrong it should be something like this

 virtualmin modify-php-ini --all-domains --ini-name session.cache_expire --ini-value 179  

and not

note you have --modify-php-ini and not modify-php-ini and maybe it needs to be the first option after the virtualmin command

and the results from my above command are like this

Updating ..                                                                                                                                                                                                                                             
.. updated 1 variables in 3 files and FPM configuration                                                                                                                                                                                                                           
Updating ..                                                                                                                                                                                                                                                      
.. updated 1 variables in 2 files and FPM configuration                                                                                                                                                                                                                           
Updating ..                                                                                                                                                                                                                                                        
.. updated 1 variables in 3 files and FPM configuration                                                                                                                                                                                                                           
Updating ..                                                                                                                                                                                                                                                      
.. updated 1 variables in 3 files and FPM configuration                                                                                                                                                                                                                           
Updating ..                                                                                                                                                                                                                                                      
.. updated 1 variables in 3 files and FPM configuration                                                                                                                                                                                                                           
Updating ..                                                                                                                                                                                                                                                    
.. updated 1 variables in 4 files and FPM configuration                                                                                                                                                                                                                           

@jimr1 you missed the point :smile: I want to update global php.ini files

Also I am not running mod_php so is this of any use?

so why is Virtualmin updating the FPM configuration then ?

That’s why I asked

So you don’t need mod php as it updates PHP-FPM files. I will propose a update to the help file.

it also edits /home/user/etc/php<version no>/php.ini files

home/user/etc/php<version no>/php.ini files

I am going to check, does PHP running in CGI and FastCGI use these php.ini files?

you will also notice there is a symlinked php.ini in /home/user/etc which point to the selected php version of php.ini located at /home/user/etc/php<version no>, so I would guess this file is parsed and will be the ini used for php running in CGI and FastCGI modes. This symlink is parsed when using cli for sure

I guess you have been reading 10 year old posts in order to think that mod_php was involved ?
As software develops documentation and/or forum posts should be taken with a pinch of salt.

@jimr1 I have used the modified commands you gave me as follows for a test, thanks.

virtualmin modify-php-ini --domain --ini-name memory_limit --ini-value 128M
virtualmin modify-php-ini --all-domains --ini-name memory_limit --ini-value 128M
  • These commands added/changed the PHP config files for in CGI, FastCGI and PHP-FPM,
    • ~/etc/php/7.4/fpm/pool.d/1231231231231234.conf
    • ~/etc/php7.4/php.ini
  • They do not change the global PHP configuration files (php.ini / .conf)


In the help file of this command it says:

This command can be used to change the value of a PHP configuration
variable (set in the php.ini file and Apache configuration) for one or
many virtual servers at once.

Do you have any idea if altering the Apache configuration with this tool is still a thing? I would like to make sure, but I do not know what would cause the Apache configuration to be altered by this command.

Anyone know what Apache Configuration files are change if any with this command?

Using php fpm why would it ? It’s so long since i used mod_php i can not remember if the apache config needed modification but that said I don’t remember have do anything after modding php.ini

do you think it is a relic from mod_php ?

I seem to remember you may have to have restart apache. But in this day and age I don’t think it matters.

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