Learn about Centmin Mod LEMP Stack today
Register Now

php-fpm bad gateway errors PHP 7.4

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Jon Snow, Mar 29, 2025.

  1. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Did we lose PHP 7.4 support in 132.00stable alma9? I know there was a notice but it doesn't look like the workaround is working anymore after upgrading centminmod and recompiling 7.4 (bad gateway on Wordpress after doing it).


    Is my only option to migrate to Alma8?
     
    Last edited: Mar 29, 2025
  2. eva2000

    eva2000 Administrator Staff Member

    55,164
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    132.00stable only change was for MariaDB 10.6 default so no change in PHP 7.4 support. Bad gateway can be due to many other unrelated issues including just being php-fpm being overloaded/crashed due to traffic, resource usage or both and makes php-fpm unable to response to nginx server. So nginx server returns a 502 bad gateway response.
     
  3. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I upgraded 3 small servers (Hetzner 3 vCPU 4GB RAM & 2 vCPU 2 GB RAM) with small sites that don't get much traffic and it affected all of them. Previously they worked perfectly on PHP 7.4 (built around the time I migrated to Alma9).

    On one, I upgraded to PHP 8.3 and it solved the issue.

    I can't upgrade PHP yet on the others because there's no alternative plugins for what I use yet.

    I think it was the PHP 7.4 recompile rather than the 132.00stable upgrade.

    When loading the page, I get "ERR_HTTP2_PROTOCOL_ERROR" and when I log into WP Admin I get the bad gateway.
     
  4. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Maybe these posts can be moved to my original thread from last year https://community.centminmod.com/threads/downgrading-php-results-in-502-bad-gateway.26872/

    Custom config:
    Code (Text):
    LETSENCRYPT_DETECT='y'
    DUALCERTS='y'
    MARCH_TARGETNATIVE='n'
    DISABLE_IPVSIX='y'
    SET_DEFAULT_MYSQLCHARSET='utf8mb4'
    SELFSIGNEDSSL_ECDSA='y'
    PHPFINFO='y'
    PHP_OVERWRITECONF='n'
    PYTHON_INSTALL_ALTERNATIVES='y'


    But this time it's just recompiling PHP 7.4 (from PHP 7.4 instead of downgrading from PHP 8)

    The error log has been logging stuff like this ever since:
    Code (Text):
    WARNING: [pool www] child 2000037 exited on signal 11 (SIGSEGV - core dumped) after 7.945090 seconds from start

    Nothing like it before recompiling PHP 7.4 in the old /var/log/php-fpm log files

    In the domain error log:
    Code (Text):
    2025/03/30 00:00:30 [error] 1753976#1753976: *18975651 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: my-ip-address, server: domain.com, request: "GET /wp-admin/ HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com"
     
    Last edited: Mar 31, 2025
  5. eva2000

    eva2000 Administrator Staff Member

    55,164
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Could be PHP 7.4 bugs related to your specific Wordpress plugins. You can try disabling Wordpress plugins and one plugin at a time re-enable and restart PHP-FPM service and wait and see if you get the same "exited on signal 11 (SIGSEGV - core dumped)" errors
     
  6. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I've already tried disabling plugins but didn't restart php-fpm right after. I just tried it but didn't help.
     
  7. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I ended up upgrading one server to PHP 8.3 and it fixed the issue (like last time).
    I deleted another server because I decided I'm no longer going to preserve that data (it's no longer needed).
    So it's just 1 more server I have that needs to be on PHP 7.4 for the next couple of years :(
     
  8. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Anything lower than PHP 8.1 has this issue it seems (7.4 and 8.0 but 8.0 isn't as bad as 7.4)

    So I think it's the workaround not working on Alma9..?
     
  9. eva2000

    eva2000 Administrator Staff Member

    55,164
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    7:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    The workaround for PHP 7.4 and 8.0 for EL9 was never 100% fix, it just allowed PHP 7.4 and 8.0 to compile on EL9. For EL9 OSes like AlmaLinux and Rocky Linux 9, real minimum PHP version is really PHP 8.1. So probably best to get your addons at least compatible with PHP =>8.1
     
  10. Jon Snow

    Jon Snow Active Member

    854
    172
    43
    Jun 30, 2017
    Ratings:
    +260
    Local Time:
    6:14 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Yea I know, but I was wondering if there's an updated workaround or if we're forced to either downgrade to EL8 / upgrade plugins now in 2025? I figure something is broken / not right from the current PHP 7.4 recompile.