Multible PHP-FPM v8.x version

Discussion in 'ISPConfig 3 Priority Support' started by cmks, Oct 23, 2023.

Tags:
  1. cmks

    cmks Member HowtoForge Supporter

    Dear,
    when I switch a website from php-fpm-v8.1 to php-fpm-v8.2 or vice versa the site is inaccesible after switching because apache can't establish a connection to the depending socket (which exists in lsof). After restarting the the server, the website works with the actual selected php version as expected. Switching back to the prior php version has the same effect. Website is inaccessible, restart the server, website is online again. And so on...

    Is this behavior by design or did I something wrong?

    Regards
    cmks

    ==========================================

    running ISPConfig 3.2.11 @ Debian (bullseye)
    with apt-source
    deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ bullseye main


    php7.3-fpm/bullseye,now 7.3.33-14+0~20230902.114+debian11~1.gbp764b27 amd64 [installiert]
    php7.4-fpm/bullseye,now 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414 amd64 [installiert]
    php8.1-fpm/bullseye,now 8.1.23-1+0~20231006.55+debian11~1.gbpe6c1a6 amd64 [installiert]
    php8.2-fpm/bullseye,now 8.2.11-1+0~20231006.34+debian11~1.gbp2676aa amd64 [installiert]

    php7.3-cli/bullseye,now 7.3.33-14+0~20230902.114+debian11~1.gbp764b27 amd64 [installiert]
    php7.4-cli/bullseye,now 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414 amd64 [installiert]
    php8.1-cli/bullseye,now 8.1.23-1+0~20231006.55+debian11~1.gbpe6c1a6 amd64 [Installiert,automatisch]
    php8.2-cli/bullseye,now 8.2.11-1+0~20231006.34+debian11~1.gbp2676aa amd64 [installiert]

    libapache2-mod-php7.3/bullseye,now 7.3.33-14+0~20230902.114+debian11~1.gbp764b27 amd64 [Installiert,automatisch]
    libapache2-mod-php7.4/bullseye,now 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414 amd64 [installiert]
    libapache2-mod-php8.1/bullseye,now 8.1.23-1+0~20231006.55+debian11~1.gbpe6c1a6 amd64 [Installiert,automatisch]
    libapache2-mod-php8.2/bullseye,now 8.2.11-1+0~20231006.34+debian11~1.gbp2676aa amd64 [Installiert,automatisch]
    libapache2-mod-php/bullseye,now 2:8.2+93+0~20230409.46+debian11~1.gbpdb4dcc all [installiert]

    (But only mod-php8.2 is enabled)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is something wrong with your system. You do not have to manually restart Apache or the server.

    mod_php does not allow version changes anyway, so it does not matter for this issue. Recent installations do not use mod_php anymore. So you should not have any sites using mod_php, all should use php-fpm.

    Possible reasons for your issue are that you might have manually restarted Apache or php-fpm using an init script while your system uses systemd (as any recent system does). Using init scripts causes systemd to fail, which can cause such restart failures. Another possible reason is that you use the wrong PHP settings, compare your settings with the ones from the multi php tutorial.

    https://www.howtoforge.com/ispconfig-php-debian/
     
  3. cmks

    cmks Member HowtoForge Supporter

    I have to restart the entire server - not only apache.

    The server is setup using the tutorials from this site - no hacks or scripts.

    I have some differences in my config compared with the multi php tutorial - my differences are analogously for all versions, so I copy on one here:

    Tutorial / PHP 7.4:
    Fast-CGI settings:
    Path to the PHP FastCGI binary: /usr/bin/php-cgi7.4
    Path to the php.ini directory: /etc/php/7.4/cgi/

    PHP-FPM settings:
    Path to the PHP-FPM init script: php7.4-fpm
    Path to the php.ini directory: /etc/php/7.4/fpm/
    Path to the PHP-FPM pool directory: /etc/php/7.4/fpm/pool.d

    My settings:
    Fast-CGI settings:
    Path to the PHP FastCGI binary: /usr/bin/php-cgi7.4
    Path to the php.ini directory: /etc/php/7.4/cgi/php.ini

    PHP-FPM settings:
    Path to the PHP-FPM init script: /usr/sbin/php-fpm7.4
    Path to the php.ini directory: /etc/php/7.4/fpm/php.ini
    Path to the PHP-FPM pool directory: /etc/php/7.4/fpm/pool.d


    I'm confused because I guess I took this settings from a post on this site. I will adopt them now....
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    cmks likes this.
  5. cmks

    cmks Member HowtoForge Supporter

    Ok, working now. Thank you.

    I guess the killing part was, I set "Path to the PHP-FPM init script" to the binary (/usr/sbin/php-fpm7.4) but the init script (php7.4-fpm) :confused:

    In the tutorial "PHP-FPM socket directory" is not mentioned - should it be left blank?

    For a default PHP v8.1 config - under "Server Config" -> Server xxx -> "Web" -> "PHP Settings" it's filled with "/var/lib/php8.1-fpm"

    Some other fields for a default PHP v8.1 setup under "Server Config" differs from them in the tutorial in section v8,1 - should I fill the same values in here? So remove "php.ini" from path-names, etc?

    upload_2023-10-23_20-59-44.png
     

    Attached Files:

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, this was the cause of the issue.

    yes

    No, you can leave them as they are.
     

Share This Page