Php

Upgrading PHP for LibreNMS on RHEL 9

LibreNMS recently raised its PHP requirement to 8.4 minimum, 8.5 recommended. If you’re still on 8.3 (or older), the web UI will nag you until you upgrade. Here’s how to do it on RHEL 9 using the Remi repository.

Prerequisites #

This assumes Remi is already installed and enabled:

dnf repolist | grep remi

You should see remi-safe and remi-modular. If not, install it first:

dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms

1. Check the current PHP module #

dnf module list php
Name                Stream                      Profiles                                  Summary
php                 remi-7.4                    common [d], devel, minimal                PHP scripting language
php                 remi-8.0                    common [d], devel, minimal                PHP scripting language
php                 remi-8.1                    common [d], devel, minimal                PHP scripting language
php                 remi-8.2                    common [d], devel, minimal                PHP scripting language
php                 remi-8.3 [e]                common [d], devel, minimal                PHP scripting language
php                 remi-8.4                    common [d], devel, minimal                PHP scripting language
php                 remi-8.5                    common [d], devel, minimal                PHP scripting language

[e] marks the currently enabled stream — 8.3 here, which is now below LibreNMS’s minimum.

Fixing LibreNMS After Updates: Missing Restify Provider

Fixing LibreNMS After Updates: Missing Restify Provider #

After a routine package update on my RHEL 9 LibreNMS server, the web UI stopped working and the logs showed a very familiar Laravel-style error:

[CRITICAL] Exception: Error Class "Binaryk\LaravelRestify\RestifyApplicationServiceProvider" not found @ /opt/librenms/app/Providers/RestifyServiceProvider.php:15

At first glance it looks like a code issue, but in this case the root cause was simpler: the PHP dependencies under /opt/librenms were stale or partially updated.