r/LibreNMS • • Sep 28 '26

PHP Update Failed

I did the required PHP update from 8.3 to 8.4. php-v shows that I am running 8.4.26 in the command line. However, my web GUI shows 502 Bad Gateway (nginx 1.18.0).

I am trying to follow the steps in a old post about updating 8.1 to 8.3. This is the validate php result.

I x'd out the rrd IP addresses here. I don't think that's the issue.

The final line of the validate says I must run this script as librenms or root, but I don't know what script that refers to.

I am a not well-versed with Linux, so I am looking for an "Idiot's Guide..."

Thank you.

Component | Version
--------- | -------
LibreNMS  | 26.9.1 (2026-09-22T13:33:27-04:00)
DB Schema | 2026_09_16_120000_widen_ent_physical_rev_columns (403)
PHP       | 8.4.26
Python    | 3.10.12
Database  | MariaDB 10.6.23-MariaDB-0ubuntu0.22.04.1
RRDTool   | 1.7.2
SNMP      | 5.9.1

[OK]    Composer Version: 2.10.3
[OK]    Dependencies up-to-date.
[OK]    Database Connected
[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
[OK]    Redis is unavailable
[OK]    No errors found with polling frequencies.
[WARN]  Could not check Python dependencies because this script is not running as librenms
[FIX]: 
The install docs show how this is done on a new install: https://docs.librenms.org/Installation/Install-LibreNMS/#configure-php-fpm
[OK]    rrd_dir is writable
[FAIL]  Some RRD files have the incorrect step. 602/6257
[FIX]: 
lnms maintenance:rrd-step all
RRD files with incorrect step:
xxx.xxx.xxx.xxx/port-id2384.rrd: the step is 300, but it must be 60

and 587 more...
[OK]    rrdtool version ok
[FAIL]  You need to run this script as 'librenms' or root

1 Upvotes

14 comments sorted by

1

u/Specialist_Play_4479 Sep 28 '26

You probably did not copy/move your PHP-FPM pool for LibreNMS to your new PHP version.
Look in /etc/php/8.3/fpm*/pool* for something like librenms.conf. Copy that to the same directory in /etc/php/8.4/fpm*/pool*

1

u/fleckermann Sep 29 '26

In my pool folder, I have only a www.conf file.

2

u/TaosMesaRat Sep 28 '26 edited Sep 28 '26

Well definitely run the validation script as librenms to start

$ sudo -i

[sudo] password for x:

root@xxx:~# su -l librenms

librenms@xxx:~$ /opt/librenms/validate.php

But my guess is bad php-fpm sock reference

systemctl status php8.4-fpm

ls -l /run/php-fpm-librenms.sock

root@xxx:# cd /etc/php

root@xxx:/etc/php# find . -name librenms.conf

./8.4/fpm/pool.d/librenms.conf

root@xxx:/etc/php#

If you only see ./8.3/fpm/pool.d/librenms.conf then you'll need to

cp /etc/php/8.3/fpm/pool.d/librenms.conf /etc/php/8.4/fpm/pool.d/librenms.conf

systemctl restart php8.4-fpm

Edit I had the wrong version in that last command.

1

u/fleckermann Sep 28 '26

Thanks for the detailed reply. I'm trying to understand it. I don't think I have php-fpm-librenms.sock in the run folder. There are several .sock files (one for 8.3, one for 8.4, etc) that are zero bytes in size.

1

u/TaosMesaRat Sep 28 '26

On my installation that socket is referenced in /etc/nginx/conf.d/librenms.conf and because it is missing you are getting the 502 error. This will probably fix it:

cp /etc/php/8.3/fpm/pool.d/librenms.conf /etc/php/8.4/fpm/pool.d/librenms.conf
systemctl restart php8.4-fpm

Sockets will normally be 0 byte size. They are special files used for Inter-Process Communication (IPC). Because that file is missing nginx web server cannot talk to php-fpm which is where LibreNMS is served.

1

u/fleckermann Sep 29 '26

There is no librenms.conf file in the 8.3 php. There is not a librenms.conf file in nginx folder either. I will be going back to the install docs. Thanks.

1

u/fleckermann Sep 29 '26

It seems that I am using apache2 as the web server, not nginx. Is this possible?

→ More replies (2)

1

u/1div0 Sep 28 '26

For NGINX to talk to PHP the socket definition in the respective configs need to match. e.g.,

librenms@libre:~$ grep '^listen =' /etc/php/8.5/fpm/pool.d/librenms.conf
listen = /run/php/php8.5-fpm-librenms.sock

librenms@libre:~$ grep fastcgi_pass /etc/nginx/conf.d/librenms.conf
#   fastcgi_pass unix:/run/php/php8.3-fpm-librenms.sock;
  fastcgi_pass unix:/run/php/php8.5-fpm-librenms.sock;

librenms@libre:~$ ls -lh /run/php/php8.5-fpm-librenms.sock
srw-rw---- 1 www-data www-data 0 Sep 28 12:49 /run/php/php8.5-fpm-librenms.sock

1

u/fleckermann Sep 30 '26

This is the solution. Thanks to everyone in the thread.

2

u/tonymurray Sep 29 '26

This is why the docs suggest you don't add the version to the php-fpm socket path... no config changes during php updates, only copy librenms.conf to the new php fpm config directory.

→ More replies (1)

2

u/ikdoeookmaarwat Sep 28 '26

> [FAIL]  You need to run this script as 'librenms' or root

fix this first