127.0.0.1:9114 is already in use - Multiple PHP-FPM woes

Discussion in 'Installation/Configuration' started by fbarcenas, Oct 27, 2017.

  1. fbarcenas

    fbarcenas Member

    I installed my server with this guide:
    https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1/
    I installed PHP-7.1 with this guide:
    https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
    When I switch sites between PHP5-FPM and PHP7-FPM sites the PHP7 will begin to give an error. 502 BAD GATEWAY
    When I try to restart PHP7 I get this:
    Code:
    [email protected]:/opt/php-7.1/etc/php-fpm.d# /etc/init.d/php-7.1-fpm restart
    Gracefully shutting down php-fpm /etc/init.d/php-7.1-fpm: line 59: kill: (29208) - No such process
    ................................... failed. Use force-exit
    Starting php-fpm [27-Oct-2017 08:52:11] ERROR: unable to bind listening socket for address '127.0.0.1:9114': Address already in use (98)
    [27-Oct-2017 08:52:11] ERROR: FPM initialization failed
    failed
    
    The only way I can get things working again is to stop and start PHP5-FPM (restart does not work) then restarting PHP7-FPM.
    It seems the web100.conf just gets copied from /etc/php5/fpm/pool.d/ to /opt/php-7.1/etc/php-fpm.d/ but the port number does not stop being served by the old PHP version until you stop and restart the old PHP version.
    Is there any fix for this?
     
    Last edited: Oct 27, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess the problem is that you are using the init script instead of the systemd unit to start / stop / restart php-fpm. On a servers that has systemd installed, use systemctl command to start / stop / restart daemons, do not use the init script as init scripts and systemd are incompatible with each other, so a service started by an init script can not be restarted with systemd and ISPConfig will always use the latest init technology that is available on a system and that is systemd.
     
    fbarcenas likes this.
  3. fbarcenas

    fbarcenas Member

    I have both init scripts and systemd installed. What would you recommend to fix the problem?? stop the services with the init script and start them with service php5-fpm start?

    Part of the PHP-fpm guide reads:
    So that is why I was using it to stop and start the service.

    OH!!! I see. I have both installed and should only USE one.
     
    Last edited: Oct 27, 2017
  4. fbarcenas

    fbarcenas Member

    I will delete the init script versions and just left the systemd versions.
     
    Last edited: Oct 27, 2017
  5. fbarcenas

    fbarcenas Member

    Ok I tried it again and still get failure:
    Code:
      php-7.0-fpm.service                       loaded    active running   The PHP 7.0 FastCGI Process Manager
    ● php-7.1-fpm.service                       loaded    failed failed    The PHP 7.1 FastCGI Process Manager
    ● php5-fpm.service                          loaded    failed failed    The PHP FastCGI Process Manage
    
    
    Oct 27 13:02:55 mx3 php5-fpm[17821]: [27-Oct-2017 13:02:55] ERROR: unable to bind listening socket for address '127.0.0.1:9113': Address already in use (98)
    Oct 27 13:02:55 mx3 php5-fpm[17821]: [27-Oct-2017 13:02:55] ERROR: FPM initialization failed
     
  6. fbarcenas

    fbarcenas Member

    I rebooted and everything came up fine.. I don't know if I'm going to have this problem again switching php versions back and forth now.
     
  7. fbarcenas

    fbarcenas Member

    I tried it a few times. Looks like it's fixed!
     

Share This Page