Switching PHP-FPM version for a domain fails the service(solved)

Discussion in 'General' started by vnagara, Jul 8, 2020.

  1. vnagara

    vnagara New Member

    Hi, I was wandering if some one had this problem. I am not sure if I just didn't configured something right or it is a bug.
    In details: I have multiple php versions for a website. As apache mod_php can be enabled only 1 I disabled that option at all.
    mod_fcgi worked fine for last 2 years, however yesterday I switched back to php-fpm and found that bug again (that the reason I used fast CGI).
    Exactly what happens: when I switch version of php from 7.4 to 7.3 ispconfig creates new pool in php7.3 and reloads it. Reloading fails as it finds the socket file web35.sock that still exists from php7.4 (as it wasn't reloaded and didn't deleted that socked). When I reload both services all works.
    Have anyone had this issues?

    ISPConfig 3.1.15p3
     
  2. vnagara

    vnagara New Member

    Just analyzed the logs. Ispconfig logs restarting 2 versions in proper order, however syslog shows only one fpm restart.
    Investigation continues...
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPconfig reloads the services in correct order, so that's not the reason for the problem. Also I never encountered this on any of my systems, but I've seen third party systems which that problem. This issue can be caused by starting the php-fpm services the wrong way, if your system supports systemd, then the services must be started with systemctl command. if your system has e.g. a init script for the php-fpm service beside the systems isn't file and you start php-fpm using that init script, then systems will not be able to reload or restart that service, and as ispconfiog defaults to systems when it#s available, ispconfig will not be able to reload or restart that service which then means that the old socket can't be removed.
     
    vnagara likes this.
  4. vnagara

    vnagara New Member

    Thanks @till for prompt response. Thanks for the loging system I was able to find the mistake. Seems I've put wrong Path to the PHP-FPM init script:. I went with analogy of Path to the PHP FastCGI binary and put path to binary that is /usr/bin/php-fpm7.4 while it parsed to php-fpm7.4 that is close but wrong service name (proper is php7.4-fpm).

    P.S. I wish when executes
    exec($initcommand.' 2>&1', $retval['output'], $retval['retval']);​
    and $retval['retval'] > 0 it would be loged at ERROR level, then I'd noticed it earlier.
    I haven't used fpm for 2 years for such silly mistake :)cry)
     

Share This Page