Additional PHP versions - all FPM sockets are using the same naming causing reload problems
short description
What is happening and what is wrong with that?
If you install multiple PHP versions and run the system via FPM, it creates all sockets with a shared 'socket_dir' causing FPM reload problems like
[07-Jul-2019 18:59:02] ERROR: An another FPM instance seems to already listen on /var/lib/php7.0-fpm/web193.sock
[07-Jul-2019 18:59:02] ERROR: FPM initialization failed
I believe the site has had the php version changed and the reload / restart failed. Entire FPM pool was down as a result of that.
correct behaviour
What should happen instead?
This should be dynamic, e.g.
listen = /var/lib/php5.6-fpm/web193.sock
listen = /var/lib/php7.2-fpm/web92.sock
environment
Server OS: Ubuntu
Server OS version: Xenial
ISPConfig version: 3.1.11
proposed fix
The template creates the socket location like so:
$socket_dir = escapeshellcmd($web_config['php_fpm_socket_dir']);
$fpm_socket = $socket_dir.$pool_name.'.sock';
This should be dynamic, e.g.
listen = /var/lib/php5.6-fpm/web193.sock
listen = /var/lib/php7.2-fpm/web92.sock
which will avoid from sockets being in use by another pool.
I'll look into creating a merge request if solution is confirmed.