PHP-FPM configuration per virtualhost

I can't find where to configure php-fpm for specific virtualhost from the GUI.

Status: 
Active

Comments

example of one of my configuration file inside /etc/php5/fpm/pool.d/:

filename: domain.ext.conf

[domain.ext]
user = user
group = user
listen = /var/run/php5-fpm-domain.ext.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 100
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 20
pm.max_requests = 500
chdir = /
env[TMP] = /home/user/.tmp
env[TMPDIR] = /home/user/.tmp
env[TEMP] = /home/user/.tmp
php_admin_value[cgi.fix_pathinfo] = 0
php_admin_value[open_basedir] = /home/user/public_html/:/home/user/.tmp/
php_admin_value[session.save_path] = /home/user/.tmp/

What settings do you want to configure exactly?

those listed in /etc/php5/fpm/pool.d/www.conf are too much? :-)

Most probably aren't safe for domain owners to edit - however, it would make sense to allow editing of php.ini options. Are these specific options that you've found it useful to tweak?

in particular:
pm =
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
pm.max_requests =

and maybe for performance monitoring:
pm.status_path =

Some of those child process related counts can be set in Virtualmin already, on the Website Options page.

But I will add the ability to edit more options to our long-term TODO list.

Per virtualserver fpm php.ini might be nice. I think currently - even though there is per user fpm - they all read /etc/php.ini ..

You can override php.ini settings in the domain's FPM pool file though (however, Virtualmin doesn't yet offer a nice API for this).

Aha, it could be hooked up in a post-pre script. Thanks

Another option that could be usefull for php-fpm virtualhosts config files is "error_log " in this way we can set specific error logs for each vhost.

EDIT: I just read that PHP errors are inside nginx error logs (https://github.com/rlerdorf/php7dev/issues/48)... so I think it's useless to have another log file only for them.

Hi guys,

I've fpm active also but if I go to 'Options page' there are not settings about child process or pm settings, like this

pool

Only way I can alter that settings is by going directly to /etc/php/7.0/fpm/php-fpm.conf file and add that settings by hand, like this:

pool1

It would be great to have it inside UI for sure!

@kpendic, on my setup those settings are overwritten in each pool config, so changing pm type in /etc/php/7.0/fpm/php-fpm.conf not change anything, I need to change it manually in each virtualhost pool config.

hey @Murz I think that I needed to restart fpm process and then each pool picked that setting automaticaly.. not sure because I think I'll ditch that manualy setting it and wait for that functionality to show in next virtualmin update.. did you see this post > https://www.virtualmin.com/comment/809046 :)

There are also per-domain FPM config file under /etc/php-fpm.d (depending on your distro) that you can edit.