Hi - I have just upgraded our Ubuntu server from 20.04 to 22.04 and am having some troubles getting it to work.
I have done the below:
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
sudo do-release-upgrade
It then rebooted into the new version. I then ran:
apt install acl curl fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd whois unzip python3-pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip
and then set the time in the php.ini files of version 8.1
I am getting this in the logs:
[2022-10-27T15:50:01.523754+01:00] production.ERROR: Undefined constant “localhost” {“exception”:"[object] (Error(code: 0): Undefined constant “localhost” at /data/librenms/config.php:86)"}
(/data is just a symbolic link to /opt/librenms)
I have checked and I have an entry in my php.ini file with that entry at line 86:
If I run the git pull then this will override all of the files in that directory including the RRD files and config.php. This would mean having to restore data to get it working again. I was hoping to do this more as an upgrade like done in PHP upgrade 7.4.3 to 8.1 - #5 by murrant by Murrant.
If I run the composer_wrapper I still get messages about the Undefined constant “localhost” I am wondering if there are any changes in the way PHP reads this between 7 and 8?
$config[‘db_host’] = localhost;
$config[‘db_name’] = librenms;
$config[‘db_user’] = *******;
$config[‘db_pass’] = ******;
Thanks, I have just tried to run git pull and it is actually responding that it is up to date:
librenms@*********:~$ git pull
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), 25.25 KiB | 1.26 MiB/s, done.
From GitHub - librenms/librenms: Community-based GPL-licensed network monitoring system
0dd183f1e…b90fbcb9b master → origin/master
Already up-to-date.
Hi
That worked thanks, I also had to amend the entry in the .env file which contained the same details. Once I did that I can get to the login screen again.