PHP Failing to Start after upgrade to Ubuntu 22 PHP 8.3 and 502 Bad Gateway on GUI

Hello,

I came into today seeing our LibreNMS was complaining about PHP dependencies being on 8.2 and we were running Ubuntu 20.xx.

I upgraded to Ubuntu 22 along with PHP 8.3.16.

After the upgrade I was still seeing the PHP dependencies message on the GUI. I used this guide;

along with this to assist in my issues;

At step 7 of the first URL the PHP service is failing to start. I verified sock matches in Nginx and Librenms Config.

/validate.sh

Component Version
LibreNMS 25.1.0-47-gf93e1b77e (2025-01-26T17:09:12+00:00)
DB Schema 2025_01_22_194342_drop_storage_deleted (312)
PHP 8.3.16
Python 3.10.12
Database MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[OK] Composer Version: 2.8.5
[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
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

After attempting to start the service;

Journalctl -xeu php8.3-fpm.service
Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ Automatic restarting of the unit php8.3-fpm.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jan 27 17:54:08 librenms-amer systemd[1]: Stopped The PHP 8.3 FastCGI Process Manager.
░░ Subject: A stop job for unit php8.3-fpm.service has finished
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A stop job for unit php8.3-fpm.service has finished.
░░
░░ The job identifier is 1910 and the job result is done.
Jan 27 17:54:08 librenms-amer systemd[1]: Starting The PHP 8.3 FastCGI Process Manager…
░░ Subject: A start job for unit php8.3-fpm.service has begun execution
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit php8.3-fpm.service has begun execution.
░░
░░ The job identifier is 1910.
Jan 27 17:54:08 librenms-amer php-fpm8.3[21986]: [27-Jan-2025 17:54:08] ERROR: invalid port value ‘/run/php/php8.3-fpm.sock’
Jan 27 17:54:08 librenms-amer php-fpm8.3[21986]: [27-Jan-2025 17:54:08] ERROR: FPM initialization failed
Jan 27 17:54:08 librenms-amer systemd[1]: php8.3-fpm.service: Main process exited, code=exited, status=78/CONFIG
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ An ExecStart= process belonging to unit php8.3-fpm.service has exited.
░░
░░ The process’ exit code is ‘exited’ and its exit status is 78.
Jan 27 17:54:08 librenms-amer systemd[1]: php8.3-fpm.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit php8.3-fpm.service has entered the ‘failed’ state with result ‘exit-code’.
Jan 27 17:54:08 librenms-amer systemd[1]: Failed to start The PHP 8.3 FastCGI Process Manager.
░░ Subject: A start job for unit php8.3-fpm.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit php8.3-fpm.service has finished with a failure.
░░
░░ The job identifier is 1910 and the job result is failed.
Jan 27 17:54:08 librenms-amer systemd[1]: php8.3-fpm.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ Automatic restarting of the unit php8.3-fpm.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jan 27 17:54:08 librenms-amer systemd[1]: Stopped The PHP 8.3 FastCGI Process Manager.
░░ Subject: A stop job for unit php8.3-fpm.service has finished
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A stop job for unit php8.3-fpm.service has finished.
░░
░░ The job identifier is 2002 and the job result is done.
Jan 27 17:54:08 librenms-amer systemd[1]: php8.3-fpm.service: Start request repeated too quickly.
Jan 27 17:54:08 librenms-amer systemd[1]: php8.3-fpm.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit php8.3-fpm.service has entered the ‘failed’ state with result ‘exit-code’.
Jan 27 17:54:08 librenms-amer systemd[1]: Failed to start The PHP 8.3 FastCGI Process Manager.
░░ Subject: A start job for unit php8.3-fpm.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit php8.3-fpm.service has finished with a failure.
░░
░░ The job identifier is 2002 and the job result is failed.

Now on the GUI I am getting a 502 Bad Gateway error

librenms.conf
Start a new pool named ‘librenms’.
; the variable $pool can be used in any directive and will be replaced by the
; pool name (‘www’ here)
[librenms]

; Per pool prefix
; It only applies on the following directives:
; - ‘access.log’
; - ‘slowlog’
; - ‘listen’ (unixsocket)
; - ‘chroot’
; - ‘chdir’
; - ‘php_values’
; - ‘php_admin_values’
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of the child processes. This can be used only if the master
; process running user is root. It is set after the child process is created.
; The user and group can be specified either by their name or by their numeric
; IDs.
; Note: If the user is root, the executable needs to be started with
; --allow-to-run-as-root option to work.
; Default Values: The user is set to master process running user by default.
; If the group is not set, the user’s group is used.
user = librenms
group = librenms

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; ‘ip.add.re.ss:port’ - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; ‘[ip:6:addr:ess]:port’ - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; ‘port’ - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; ‘/path/to/unix/socket’ - to listen on a unix socket.
; Note: This value is mandatory.
listen = fastcgi_pass unix:/run/php/php8.3-fpm.sock;

; Set listen(2) backlog.
; Default Value: 511 (-1 on Linux, FreeBSD and OpenBSD)
;listen.backlog = 511

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions. The owner
; and group can be specified either by name or by their numeric IDs.
; Default Values: Owner is set to the master process running user. If the group
; is not set, the owner’s group is used. Mode is set to 0660.
listen.owner = librenms
listen.group = librenms
;listen.mode = 0660

; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =

; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
;listen.allowed_clients = 127.0.0.1

; Set the associated the route table (FIB). FreeBSD only
; Default Value: -1

nginx/conf.d/librenms.conf

server {
listen 8000;
server_name ;
root /opt/librenms/html;
index index.php;

charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/].php(/|$) {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_split_path_info ^(.+.php)(/.+)$;
include fastcgi.conf;
}
location ~ /.(?!well-known).* {
deny all;
}
}

Any assistance would be greatly appreciated.

Thank you,

This issue has been resolved. The listening ports had to be updated across, www.conf, librenms.conf and nginx.conf. Walked through the initial configuration docs and was able to start PHP and Rebooted both NGINX and PHP and got the Web GUI back up and online.

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