Php-fpm questions

Ubuntu Linux 20.04.2 Webmin version 1.962 Virtualmin version 6.14
Hi,
To get HTTP2 running I needed php-fpm. I installed everything and HTTP2 is up an running.
No Problems so far.
I created a Virtual Server (Website Options > [PHP script execution mode] is FCGId ).
and created a pool for it in /etc/php/7.4/fpm/pool.d/myserver.conf with these mods.
user = myserver
group = myserver
listen.owner = myserver
listen.group = myserver
php_admin_value[upload_max_filesize] = 256M
php_admin_value[max_input_vars] = 5000

The problem is that phpinfo() does not recognize custom variable values I set up.
Also trying to run phpmyadmin which is complaining about the tmp directory ‘is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.’

I then switched to FPM (run as virtual server owner) and phpmyadmin stopped complaining and it managed to create its tmp folder and files.
Also, in /etc/php/7.4/fpm/pool.d/ I now have a new conf file 1615214450510799.conf !!!
When I append my variables to this file, then phpinfo() recognizes them.
php_admin_value[upload_max_filesize] = 256M
php_admin_value[max_input_vars] = 5000

Question #1:
Did I leave anything out or have I done everything ok?

Question #2:
Why 1615214450510799.conf and not myserver.conf? Why when I switch back to FCGId this file is deleted?

Question #3:
Can FCGId also be configured similarly? What should I name the conf file? Is there any benefit running FCGId instead of FPM mode?

For each virtual server (i.e. domain) that you create in Virtualmin, and for which you select PHP-FPM as execution method, there will be a config file created with a name of the kind you have listed.

This gives you the ability to configure PHP-FPM for each domain seperately, a very powerful feature which I recently used to host hundreds of WordPress websites on a Virtualmin server which has relatively modest specs.

Why the seemingly random numbers as name of the config file, rather than the domain name? Only the Virtualmin Gods would know the answer to that.,

1 Like

@Rory_Bremner1,

First off, you don’t create the “pool” file manually, this is created by Virtualmin automatically for you with the most appropriate settings.

Refer to the previous statement.

The number in the filename is the “domain ID” generated by Virtualmin and allows Virtualmin to find the appropriate configuration file when making edits via the GUI or CLI. The file is deleted when you switch between execution modes as FCGId does NOT use configurations that are specific to PHP-FPM.

FPM stands for “FastCGI Process Manager” which is a newer implementation of the FCGId protocol and is recommended for usage over the older FCGId mode in most cases.

If you require further assistance or would like to go over anything you don’t understand, you may reach out to me to setup a screen sharing session to discuss and/or address things.

Best Regards,
Peter Knowles | TPN Solutions

Professional, Affordable IT Support - https://tpnassist.com

1 Like

Joe has often commented here that PHP-FPM should be used in preference over other options. Sometimes the comment is in the context of better security of the shared hosting environment, sometimes in context of performance and support at the OS level (e.g. CentOS 8).

2 Likes

Thanks guys for your replies. Thanks also for confirming that I have done things properly.

Would you happen to know how to switch from FCGId to FPM with bash or with virtualmin CLI?

This way I can use virtualmin list-domains [–id number] and modify the conf file also for each domain I create.

You’re making this more complicated than it needs to be. Virtualmin can create the configuration for you.

I don’t know of any reason to prefer FCGId at this point. You don’t name the conf files, Virtualmin does.

FCGId may be necessary, for now, if you’re using multiple PHP versions, but I don’t recommend doing that either, generally speaking. And, that’s not really a technical thing, just an implementation detail in Virtualmin…pretty soon Virtualmin will be able to do multiple PHP versions with PHP-FPM (though again, I would discourage folks from doing so unless absolutely necessary).

1 Like

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