Change php version (php-fpm) gives error 500

Discussion in 'Developers' Forum' started by Rein van 't Veer, Aug 23, 2016.

  1. Hey,

    I just tested the following:
    When changing a php version the restart process is only called for the new version.
    As the old version is not restarted, it keeps the lock on the process and therefor the newer version cannot run!

    It should first do the rewrite, then restart the old version process and then restart the new version.
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I've seen some goofiness to do with switching php modes/versions too (eg. old hhvm processes left running after changing to another mode), but haven't tracked down a specific sequence to reproduce a given issue; I suspect there are several cases. I was adding new php versions though, including figuring out (by making a couple mistakes) the init scripts, so figure most of my issues could have been my own doing. I think I've been able to change versions lately without issues, once init scripts and php config was setup right; I also don't see any lock file per se, each php version has a different path to the socket and .pid files, so even if an old process were left running, the new one should work fine (and web server config file would point to the new socket path), so it's only a problem till reboot (though still should be fixed). I'm using debian 8 with systemd, maybe different init scripts work differently.
  3. care to share your init php code? i'll see if they are any different to mine
  4. till

    till Super Moderator Staff Member ISPConfig Developer

  5. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    My init script is based on the one @till linked to, the only differences are the version numbers and:
    # Required-Start:    $remote_fs $network
    # Required-Stop:     $remote_fs $network
    Ah, maybe I've created problems there, as I do have both.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Maybe I should have explained that a bit more detailed. The problem happens if you have and use both scripts, just having them causes no problem as long as only the systemd one is used on a systemd system. The reason is that systemd is not able to restart a service started by the init script and vice versa. So if you start php-fpm with the init script on a systemd server and ispconfig tres later to reload php-fpm with systemd to apply config changes, the the reload will not happen and the config changes dont get applied as systemd is not able to reload the php-fpm process that was started by the init script.

Share This Page