webmin: PHP5-FPM fails to detect ports in use, fails to startup.

Service php5-fpm fails to start. Port 8000 is already in use by another http server process (not apache), in fact the other server process running on port 8000 is managed by a standard webmin module, and post 8000 is set in its settings, and the port number is visible on the webmin servers web interface.

Mar 18 01:01:13 server1 php5-fpm[8840]: [18-Mar-2017 01:01:13] ERROR: unable to bind listening socket for address '8000': Address already in use (98)
Mar 18 01:01:13 server1 php5-fpm[8840]: [18-Mar-2017 01:01:13] ERROR: FPM initialization failed
Mar 18 01:01:13 server1 systemd[1]: php5-fpm.service: main process exited, code=exited, status=78/n/a
Mar 18 01:01:13 server1 systemd[1]: Failed to start The PHP FastCGI Process Manager.
Mar 18 01:01:13 server1 systemd[1]: Unit php5-fpm.service entered failed state.
Mar 18 01:03:30 server1 systemd[1]: Stopped The PHP FastCGI Process Manager.

EDIT: netstat also shows port 8000 is in use, for both tcp and tcp6.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 2
  • Comments: 26

Most upvoted comments

The ports being changed un-necessarily is a bug - that feature was only supposed to fix clashes due to multiple PHP-FPM packages being installed with conflicting default ports. The next release will fix it.

After upgrade to last versions:

   webmin (1.900 => 1.921)
   webmin-virtual-server (6.06.gpl-2 => 6.07.gpl)

all php-fpm ports are changed (more info here) - this is not so critical (bur very bad), other problem is that one of virtualserver got already busy port 8080 and php-fpm fail to restart with error:

ERROR: unable to bind listening socket for address '8080': Address already in use (98)

This port is used by other process:

$ netstat -lpnN | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      10005/gulp          

The next release of Virtualmin will add a check for ports in use by other apps in order to prevent this. However, the current version does attempt to test ports by connecting to the port on localhost. So I’m surprised that this doesn’t detect that port 8000 is in use…

@MurzNN - this requires an update to the Virtualmin package, which is separate from Webmin