multiple php version switch with php-fpm

Hi, I installed php7.2 version and has 7.0 that came with virtualmin as default. I couldnt find switch from php7.0 to 7.2 when using php-fpm as PHP script execution mode. Is there any documentation about this?

Fixed (pending)


Howdy -- unfortunately, due to the nature of how PHP-FPM works, it's not possible to switch between multiple PHP versions. You'd need to be using CGI/FCGID for that.

It looks like you're using Virtualmin GPL there though... if you're using Virtualmin GPL, and you had any followup questions, you'd want to use the Forums for support.

We monitor the Forums, along with lots of wonderful folks in the community. Thanks!

In theory we might support this in future, but right now only one FPM version can be selected.

+1 for multiple php versions for fpm

@andreychek you are wrong. It is perfeclty possible to run multiple php-fpm versions on different ports/sockets, like one for each virtual server. (i thinks its already done the way that there is a fpm pool per virtual server, there is just no version switch, but i need to check).

This is the #1 feature for me, the only thing i am missing when coming from Plesk. In Plesk you can switch versions on per-domain (virtual server) basis, which is totally sufficient for most projects. Different FPM-Versions per Directory is a feature that i would'nt miss (while i also think that this is possible with php-fpm!).

Yes, multiple FPM versions is technically possible with the right configs - we just have to implement it in Virtualmin.

I would be very grateful if you could add this feature.

It's on our TODO list.

+1 on this. Glad to hear its on the todo!

Is PHP Switching through Virtualmin possible now, how soon can we get this feature.

I have tried FCGID but it does not reflect version I changed, do I need to do anything else before and after changing PHP version.

Multiple versions are still only supported in CGI and fCGId modes.


I need to run php7.2, but I cannot make it work ;-( Is it possible? If yes what's the best way?

Thanks in advance.

We'd be happy to talk about PHP 7.2! Though that's a different issue than the posts above. Could you open a separate request for that? Then we won't get the topics here too mixed up. Thanks!

The Problem is that virtualmin sticks to one PHP Version for FPM. If you install i.e. PHP 7.2 in addition to 7.0 you are not able to select it for PHP-FPM. This can be worked around by uninstalling all other PHP-FPM variants (cgi and others can remain). If PHP 7.2 is the only PHP-FPM version left installed, it will be selected. A virtualmin Configuration check/rescan could be required.

Right, multiple FPM version support is still in the works.

If I have only php72 from remi installed, I can't select FPM mode: Failed to save website options : No PHP versions found for mode fpm FPM pool is running ok.

Only one php version in fpm should work. Even the remi one.

If you have somewhere config another in the fpm mode then no, that is virtualmin for the moment not supporting. No matter wich repo is used. UH normally you don;t have only one remi php , you still ( should) have the default virtualmin php's somewhere i think, while wiping them virtualmin php's completly wasn't working before.

You have to configure set first the default php version for the virtual server. Only after that you can switch / set for that virtualserver and php version to the fpm mode.

Don;t know by head were these 2 parts are in the panel, but at 2 diferent places , i have to search myself each time before i can set fpm, to have the php version set right at another places in the panel. ( so first select the php version , then go to the other place where you can choose the fpm mode.)

Yes, I have only one version - 7.2. Default 5.4 and 7.0 was removed. There is new install, only removed all php and installed new one. There is no any debug log from save_phpmode.cgi?mode=fpm , so I don't know what error inside.

virtualmin check-config
The following PHP versions are available : 7.2.10 (/bin/php72-cgi), 7.2 (mod_php)
PHP-FPM support is available on this system.
PHP versions have changed to 7.2, 7.2 since last check. Regenerating any missing php.ini files.

ps aux | grep fpm
root      1069  0.0  0.0 476968 14032 ?        Ss   14:59   0:00 php-fpm: master process (/etc/opt/remi/php72/php-fpm.conf)
apache    1070  0.0  0.0 476968  7000 ?        S    14:59   0:00 php-fpm: pool www
apache    1071  0.0  0.0 476968  7000 ?        S    14:59   0:00 php-fpm: pool www
apache    1072  0.0  0.0 476968  7000 ?        S    14:59   0:00 php-fpm: pool www
apache    1073  0.0  0.0 476968  7000 ?        S    14:59   0:00 php-fpm: pool www
apache    1074  0.0  0.0 476968  7004 ?        S    14:59   0:00 php-fpm: pool www

cat /etc/opt/remi/php72/php-fpm.d/www.conf
listen =

Also there is no listen = /var/run/php-fpm.sock

Sure, one PHP version should work. Did you already open a separate bug for this?

Running Centos6, I have multiple php versions installed including php-fpm for php7.2 only. Selecting FPM as execution mode forces the php version to go to 5.3 which is obviously not ideal. Even changing the default PHP version to 7.12 makes no difference.

The real issue here is that Joomla is aggressively pushing a Php7.x min for the soon to be released versions and running 7.12 without FPM (for me at least) is unusable due to mem allocation erros such as this:

In short... +1 for FMP support for multiple php setups.

Hi guys,

is there any ETA for that functionality?


It's on the todo list for the future, though we unfortunately don't have an ETA at the moment.

In the meantime you can select different PHP versions using FCGID/CGI.

Yes I know for selecting diff version via FCGID/CGI mode but fpm..

is there a way to do it manualy, or by cli? I'd tried something like this:

mv /etc/php/7.0/fpm/pool.d/1*.conf /etc/php/7.2/fpm/pool.d

systemctl -a restart php7.0-fpm && systemctl -a restart php7.2-fpm

and for now it works, but I have a filling that I'm missing something ..

Fixed (pending)

Ok, after much work support for running multiple PHP-FPM versions and being able to select a version on a domain-by-domain basis has been implemented in Virtualmin. This will be included in the next release.

Great! looking forward for testing this.

This is great news! Many thanks for your work on this.

Great news,

thanks a bunch for this! Looking forward to this!