Can not switch to fpm mode

Currently I can not switch php execution mode to fpm. Existing servers with fpm still runs fine.

I am using Ubuntu 16.04 with nginx and php7 shipped with the os.

Status: 
Active

Comments

Howdy -- what output do you receive if you go into System Settings -> Re-Check Configuration?

However, I believe the behavior you're experiencing is expected, in that I think switching PHP Execution Modes is only supported when using Apache.

tpnsolutions's picture
Submitted by tpnsolutions on Mon, 07/10/2017 - 14:04

As Eric has mentioned, I too believe the "Website Options" page is primarily designed for Apache usage. Since Apache has been around since the beginning, it's quite possible you'll notice a lot of features that are slanted in it's direction as nginx support is fairly new in comparison.

-Peter

The config check tells me everything is fine. Screenshot_20170711_001724
free image hosting

It has worked in the past. Since the installation of my two server I am using Nginx. And I changed the mode for my domain to fpm on the page shown above... so the fpm feature was available in the past....

Please see the changelog on github...

https://github.com/virtualmin/virtualmin-nginx/blob/master/CHANGELOG

Added support for FPM as an execution mode, if Virtualmin 5.06 and FPM packages are installed.

So where can I change the mode if not there...

FPM mode should work under Nginx, as long as the needed packages are installed on your system.

Do any of the directories matching /etc/php-fpm.d , /etc/php*/fpm/pool.d or /etc/php/*/fpm/pool.d exist on your system?

/etc/php/7/fpm/pool.d exists and there are many pools for domains switched to fpm in the past.

Screenshot_20170711_032549
image uploader

gnilebein - did the ability to select FPM mode suddenly stop working when you upgraded to Virtualmin 5.99 ?

I can't say it exactly but it seems so.

Hello @ll,

I did some more tests:

  1. Generally the fpm detection seems to work. I can select it as default mode in server templates.

Screenshot_20170712_223138

  1. If the default mode is selected and I create a new server, virtualmin create a fpm pool and the new server is running in fpm mode.

Screenshot_20170712_224044

But I still can not switch the mode manually for existing servers.

What if you use a shell API command, like virtualmin modify-web --domain yourdomain.com --mode fpm

root@server01:~# virtualmin modify-web --domain server01.gnilebein.de --mode fpm             
The selected PHP exection mode cannot be used with server01.gnilebein.de

I tried it with da fresh installation of Ubuntu 16.04 and virtualmin (with NGinx) an i got the same problem.

If you need access to my server for testing purposes just sent me an your SSH Public Key and i will create an account for you.

Ok, it looks like the issue is that FPM support isn't installed on your system.

You should be able to fix this by running apt-get install php-fpm as root. Then run virtualmin check-config to see if it reports if FPM mode is enabled ... and if not, why not.

FPM is already installed:

root@server01:~# aptitude search fpm |grep  ^i
i   php-fpm                         - server-side, HTML-embedded scripting langu
i A php7.0-fpm                      - Serverseitige, in HTML eingebettete Skript
root@server01:~# aptitude install php-fpm  php7.0-fpm
php-fpm is already installed at the requested version (1:7.0+35ubuntu6)
php7.0-fpm is already installed at the requested version (7.0.18-0ubuntu0.16.04.1)
php-fpm is already installed at the requested version (1:7.0+35ubuntu6)
php7.0-fpm is already installed at the requested version (7.0.18-0ubuntu0.16.04.1)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

This is the output of virtualmin check-config:

root@server01:~# virtualmin check-config
Your system has 5.83 GB of memory, which is at or above the Virtualmin recommended minimum of 256 MB.

BIND DNS server is installed, and the system is configured to use it.

Mail server Postfix is installed and configured.

Postfix is configured to support per-domain outgoing IP addresses.

Webalizer is installed.

MySQL is installed and running.

ProFTPD is installed.

Logrotate is installed.

SpamAssassin and Procmail are installed and configured for use.

ClamAV is installed and assumed to be running.

Plugin Nginx SSL website is installed OK.

Plugin Nginx website is installed OK.

Using network interface ens3 for virtual IPs.

IPv6 addresses are available, using interface ens3.

Default IPv4 address for virtual servers is 5.45.108.193.

Default IPv6 address for virtual servers is 2a03:4000:6:214a::.

Default IP address is set to 5.45.108.193, which matches the detected external address.

Both user and group quotas are enabled for home and email directories.

Warning - the name service caching daemon (NSCD) is running on your system. This may prevent Virtualmin from properly creating new Unix users and groups.

All commands needed to create and restore backups are installed.

The selected package management and update systems are installed OK.

Chroot jails are not available : The Jailkit command jk_init was not found on your system - maybe the packet is not installed?

OK

BTW: I tried the command on a server where FPM is not installed. There was no report that is is not installed with that command....

And PHP FPM ist already running for many servers:

root@server01:~# ps faxu | grep fpm
root      2068  0.0  0.0  15796   940 pts/0    S+   10:34   0:00          \_ grep --color=auto fpm
root      2423  0.0  0.1 736188 11500 ?        Ss   Jul04   2:41 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
gnilebe+  2432  0.1  0.6 724696 42368 ?        S    Jul04  22:29  \_ php-fpm: pool 136493812510468
gnilebe+  2433  0.0  0.0 632800  2380 ?        S    Jul04   0:00  \_ php-fpm: pool 136493855711399
gnilebe+  2435  0.0  0.0 632800  2380 ?        S    Jul04   0:00  \_ php-fpm: pool 136799859022838
gnilebe+  2436  0.0  0.0 633300  5640 ?        S    Jul04   0:00  \_ php-fpm: pool 138210013132365
gnilebe+  2437  0.0  0.2 642168 15496 ?        S    Jul04   0:14  \_ php-fpm: pool 13857322603365
gnilebe+  2438  0.0  0.0 633328  5704 ?        S    Jul04   0:00  \_ php-fpm: pool 14136703684844
feuerwe+  2439  0.0  0.9 739916 57744 ?        S    Jul04  14:40  \_ php-fpm: pool 141465609123204
feuerwe+  2440  0.0  0.2 706908 12568 ?        S    Jul04   3:00  \_ php-fpm: pool 14146668496900
gnilebe+  2441  0.0  0.0 632800  2376 ?        S    Jul04   0:00  \_ php-fpm: pool 143774462325105
gnilebe+  2443  0.0  0.1 633108  8096 ?        S    Jul04   0:00  \_ php-fpm: pool 148472438120816
feuerbi+  2444  0.0  0.0 621324  2368 ?        S    Jul04   0:00  \_ php-fpm: pool 149025753229997
feuerbi+  2445  0.0  0.1 711984  8556 ?        S    Jul04   0:00  \_ php-fpm: pool 149120414511840
gnilebe+  2909  0.1  0.7 724716 44556 ?        S    Jul04  22:19  \_ php-fpm: pool 136493812510468
feuerwe+  2930  0.0  0.9 737796 55424 ?        S    Jul04  14:29  \_ php-fpm: pool 141465609123204
feuerwe+  2936  0.0  0.1 709172  8112 ?        S    Jul04   2:59  \_ php-fpm: pool 14146668496900
gnilebe+  3360  0.1  0.6 722692 40524 ?        S    Jul04  22:25  \_ php-fpm: pool 136493812510468
feuerwe+  3625  0.0  0.9 739844 57700 ?        S    Jul04  14:36  \_ php-fpm: pool 141465609123204
gnilebe+  6247  0.0  0.1 642184  9048 ?        S    Jul04   0:10  \_ php-fpm: pool 13857322603365
gnilebe+ 19774  0.0  0.1 637896  9540 ?        S    Jul05   0:10  \_ php-fpm: pool 13857322603365
feuerwe+ 20786  0.0  0.9 737704 55788 ?        S    Jul05  13:13  \_ php-fpm: pool 141465609123204
feuerwe+ 20788  0.0  0.9 737800 55920 ?        S    Jul05  13:17  \_ php-fpm: pool 141465609123204
feuerwe+ 20792  0.0  0.1 707116 10728 ?        S    Jul05   2:24  \_ php-fpm: pool 14146668496900
feuerbi+  8076  0.0  0.0 621324  2344 ?        S    Jul05   0:00  \_ php-fpm: pool 149025753229997
gnilebe+ 19728  0.0  0.0 633300  5448 ?        S    Jul06   0:00  \_ php-fpm: pool 138210013132365
gnilebe+ 27634  0.0  0.0 633328  5492 ?        S    Jul07   0:00  \_ php-fpm: pool 14136703684844
feuerbi+ 28048  0.0  0.1 638256  8144 ?        S    Jul07   0:00  \_ php-fpm: pool 149120414511840
gnilebe+  4857  0.0  0.1 650104  7708 ?        S    Jul08   0:08  \_ php-fpm: pool 13857322603365
feuerwe+ 19512  0.0  0.2 706972 14012 ?        S    Jul09   1:25  \_ php-fpm: pool 14146668496900
gnilebe+ 26659  0.0  0.1 633108  8060 ?        S    Jul09   0:00  \_ php-fpm: pool 148472438120816
feuerbi+ 21980  0.0  0.1 635672  8512 ?        S    Jul09   0:00  \_ php-fpm: pool 149120414511840
gnilebe+ 12676  0.0  0.4 724448 26392 ?        S    Jul11   0:49  \_ php-fpm: pool 136541079524865
gnilebe+ 12809  0.0  0.3 718300 20792 ?        S    Jul11   0:47  \_ php-fpm: pool 136541079524865
gnilebe+ 12814  0.0  0.3 718556 20208 ?        S    Jul11   0:46  \_ php-fpm: pool 136541079524865
gnilebe+ 12817  0.0  0.3 720364 20840 ?        S    Jul11   0:45  \_ php-fpm: pool 136541079524865
gnilebe+ 12819  0.0  0.4 722404 25516 ?        S    Jul11   0:46  \_ php-fpm: pool 136541079524865
gnilebe+ 15395  0.1  0.6 724548 42128 ?        S    Jul11  12:11  \_ php-fpm: pool 136493812510468
gnilebe+ 30090  0.1  0.6 724488 41824 ?        S    Jul12   9:56  \_ php-fpm: pool 136493812510468
gnilebe+ 13629  0.0  0.4 644872 28392 ?        S    Jul14   1:21  \_ php-fpm: pool 14827103663671
gnilebe+ 13668  0.0  0.4 648012 28564 ?        S    Jul14   1:20  \_ php-fpm: pool 14827103663671
gnilebe+ 13901  0.0  0.4 720444 29896 ?        S    Jul14   1:22  \_ php-fpm: pool 14827103663671
gnilebe+ 21427  0.1  0.4 643860 27572 ?        S    Jul15   1:04  \_ php-fpm: pool 14827103663671
gnilebe+ 21428  0.1  0.4 643784 27572 ?        S    Jul15   1:04  \_ php-fpm: pool 14827103663671

Odd that there was no mention at all of FPM support in the check-config output. Is this system running Virtualmin 5.99 ?

Yes it is.

root@server01:~# apt-show-versions webmin-virtual-server webmin webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl
webmin:all/virtualmin-universal 1.850 uptodate
webmin-virtual-server:all/virtualmin-universal 5.99.gpl uptodate
webmin-virtualmin-nginx:all/virtualmin-universal 2.2 uptodate
webmin-virtualmin-nginx-ssl:all/virtualmin-universal 1.5 uptodate

Edit: I have created an ssh and virtualmin account for you and sent the credentials to jcameron@virtualmin.com. you can use the share... and server01... vhost for testing

Try it now - I found a bug in the code that checks for FPM support where it was looking for a particular Apache feature, even when Apache wasn't installed!

Thank you for your help. That sounds good. So this bug will be fixed in the 6.0 release?

Yes, the fix will be included in the 6.0 release.