Issue Migrating from php 8.1 to 8.3

I’m truly out of ideas at this point. I tries to follow the instructions posted here to no avail. I use Nginx.
My ./validate.php looks like this:

===========================================
Component | Version
--------- | -------
LibreNMS  | 24.11.0-84-gac7c8e747 (2024-12-08T08:21:08-07:00)
DB Schema | 2024_10_20_154356_create_qos_table (310)
PHP       | 8.3.6
Python    | 3.12.3
Database  | MariaDB 10.11.8-MariaDB-0ubuntu0.24.04.1
RRDTool   | 1.7.2
SNMP      | 5.9.4.pre2
===========================================

[OK]    Composer Version: 2.8.3
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[WARN]  Using database for locking, you should set CACHE_DRIVER=redis
[OK]    rrd_dir is writable
[OK]    rrdtool version ok
[WARN]  Your install is over 24 hours out of date, last update: Sun, 08 Dec 2024 15:21:08 +0000
        [FIX]:
        Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]:
        You can fix this with ./scripts/github-remove
        Modified Files:
         composer.json

my page still shows a 502 bad gateway error. When looking at the Nginx error logs it shows this (removed my IPs):
2024/12/09 14:47:52 [crit] 1351#1351: *7 connect() to unix:/run/php/php8.3-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: , server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm.sock:", host:

Not sure what to do from here. I’ve been consulting a lot of posts from this forum but I believe I’ve just made things worse at this point. I’d really like to not have to start over from scratch.

You’ve not configured php-fpm and nginx to use the same sock file.

Check the listen line in /etc/php/8.3/fpm/php.ini then compare that to /etc/nginx/conf.d/librenms

1 Like

Hi, thanks for your response. I wasn’t able to find any listen line in the php.ini file. For the librenms.conf file, my listen line looks like this:

fastcgi_pass unix:/run/php/php-fpm-librenms.sock

Sorry /etc/php/8.3/fpm/pool.d/librenms.conf

1 Like

Ah, checking that one and the listen section is the same:

listen = /run/php/php-fpm-librenms.sock

Unless that looks wrong to you.

I just went through this a few weeks ago.

grep unix /etc/nginx/conf.d/librenms.conf showed
fastcgi_pass unix:/run/php8.3-fpm.sock;
which needed to match the listen line in /etc/php/8.3/fpm/pool.d/librenms.conf
listen = /run/php8.3-fpm.sock
My listen line didn’t match so I made it the same as the unix listen port and librenms webgui came back w/o bad gateway errors.

Tried that again and I still get a 502 and the same error in the nginx logs :frowning:

2024/12/10 15:08:56 [crit] 1367#1367: *3 connect() to unix:/run/php/php8.3-fpm.sock failed (2: No such file or directory) while connecting to upstream

Can you post the results of
grep unix /etc/nginx/conf.d/librenms.conf
grep listen /etc/php-fpm.d/librenms.conf
?

Sure, here you go:

fastcgi_pass unix:/run/php/php8.3-fpm.sock;

grep: /etc/php-fpm.d/librenms.conf: No such file or directory

EDIT: I have a /etc/php but not a /etc/php-fpm.d

Sorry, meant
grep listen /etc/php/8.3/fpm/pool.d/librenms.conf

; - 'listen' (unixsocket)
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;   'port'                 - to listen on a TCP socket to all addresses
;   '/path/to/unix/socket' - to listen on a unix socket.
listen = /run/php/php8.3-fpm.sock
; Set listen(2) backlog.
;listen.backlog = 511
listen.owner = librenms
listen.group = librenms
;listen.mode = 0660
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
listen.acl_groups =
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
;listen.allowed_clients = 127.0.0.1
;listen.setfib = 1
;   listen queue         - the number of request in the queue of pending
;                          connections (see backlog in listen(2));
;   max listen queue     - the maximum number of requests in the queue
;   listen queue len     - the size of the socket queue of pending connections;
;   listen queue:         0
;   max listen queue:     1
;   listen queue len:     42
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;   'port'                 - to listen on a TCP socket to all addresses
;   '/path/to/unix/socket' - to listen on a unix socket.
; Default Value: value of the listen option
;pm.status_listen = 127.0.0.1:9001

Check your /run directory. If you have the php8.3-fpm.sock there, you should edit your /etc/nginx/conf.d/librenms to match:
fastcgi_pass unix:/run/php8.3-fpm.sock;

For whatever reason, even though there is the same exact file in /run/php, pointing nginx to the /run/php8.3-fpm.sock worked for me. I didn’t dig into why it wouldn’t work pointing to the same .sock file under /run/php/

Maybe a php guru can comment :stuck_out_tongue_winking_eye:

Have you actually started php-fpm? systemctl start php8.3-fpm

Yes, the service is running:

     Loaded: loaded (/usr/lib/systemd/system/php8.3-fpm.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-12-10 15:08:28 MST; 16h ago
       Docs: man:php-fpm8.3(8)
    Process: 1240 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.3/fpm/pool.d/www.conf 83 (code=exited, status=0/SUCCESS)
   Main PID: 1196 (php-fpm8.3)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
      Tasks: 3 (limit: 9308)
     Memory: 17.7M (peak: 18.4M)
        CPU: 4.038s
     CGroup: /system.slice/php8.3-fpm.service
             ├─1196 "php-fpm: master process (/etc/php/8.3/fpm/php-fpm.conf)"
             ├─1238 "php-fpm: pool librenms"
             └─1239 "php-fpm: pool librenms"

Dec 10 15:08:18 Librenms-Server systemd[1]: Starting php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager...
Dec 10 15:08:28 Librenms-Server systemd[1]: Started php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager.

@DBolt Unfortunately it’s only in /run/php/
Should I move it out of there?
this is all really confusing :frowning:

I wouldn’t move it. Figure out how to point your nginx config to it.

I fixed it!

I went inside of /etc/php/8.3/fpm/pool.d and edited www.conf instead of librenms.conf
There I changed the “listen” line to listen = /run/php/php8.3-fpm.sock
then ran sudo systemctl restart php8.3-fpm and the webpage came back online!

Thanks for everyone’s help.

Your install is not following the installation instructions, I’d go back through and correct the fpm config to avoid any future issues.

I’m not really sure how to go about that at this point. When I had the fpm settings match the instructions it wouldn’t show the web ui. Should I just migrate the install and start over?

No, just go back through the install docs, you should be able to copy / paste your way through with no issues.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.