For those of you that need to upgrade their php from 7.2 to 7.4, here is the process that I went through and was able to do so easily on Ubuntu18.04LTS
vi /etc/php/7.4/fpm/php.ini
vi /etc/php/7.4/cli/php.ini
Configure PHP-FPM
cp /etc/php/7.4/fpm/pool.d/www.conf /etc/php/7.4/fpm/pool.d/librenms.conf
vi /etc/php/7.4/fpm/pool.d/librenms.conf
[www] to [librenms]
user = librenms
group = librenms
listen = /run/php-fpm-librenms.sock
update /etc/apache2/sites-available/librenms.conf
mv /etc/apache2/sites-available/librenms.conf /etc/apache2/sites-available/librenms-7.2.conf
vi /etc/apache2/sites-available/librenms.conf
*** use this as template; dont forget to change this per your 7.2 verision ***
have troubles to add php7.4 libraries for Raspbian/buster:
sudo add-apt-repository ppa:ondrej/php
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster
sudo add-apt-repository ppa:ondrej/apache2
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster
apt install composer php7.4 php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-snmp php7.4-xml php7.4-zip
Packet lists are read... Done
Dependency tree is built.
Status information is read.... Ready
E: Package php7.4 cannot be found.
E: Using the pattern "php7.4" no package could be found.
E: Using the regular expression "php7.4" no package could be found.
E: Package php7.4-cli could not be found
E: No package could be found using the pattern "php7.4-cli".
E: No package could be found using the regular expression "php7.4-cli".
E: Package php7.4-curl could not be found.
E: No package could be found using the pattern "php7.4-curl".
E: No package could be found using the regular expression "php7.4-curl".
E: Package php7.4-fpm could not be found
E: No package could be found using the pattern "php7.4-fpm".
E: No package could be found using the regular expression "php7.4-fpm".
E: Package php7.4-gd could not be found
E: No package could be found using the pattern "php7.4-gd".
E: No package could be found using the regular expression "php7.4-gd".
E: Package php7.4-json could not be found
E: No package could be found using the pattern "php7.4-json".
E: No package could be found using the regular expression "php7.4-json".
E: Package php7.4-mbstring could not be found.
E: No package could be found using the pattern "php7.4-mbstring".
E: No package could be found using the regular expression "php7.4-mbstring".
E: Package php7.4-mysql could not be found
E: No package could be found using the pattern "php7.4-mysql".
E: No package could be found using the regular expression "php7.4-mysql".
E: Package php7.4-snmp could not be found.
E: No package could be found using the pattern "php7.4-snmp".
E: No package could be found using the regular expression "php7.4-snmp".
E: Package php7.4-xml could not be found.
E: No package could be found using the pattern "php7.4-xml".
E: No package could be found using the regular expression "php7.4-xml".
E: Package php7.4-zip could not be found.
E: No package could be found using the pattern "php7.4-zip".
E: Using the regular expression "php7.4-zip" no package could be found.
I followed this guide and everything was fine until last command. This part was not clear to me. i just put it as it is but maybe thats wrong
[www] to [librenms]
user = librenms
group = librenms
listen = /run/php-fpm-librenms.sock
This is the error
nov 12 21:25:00 netbox systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
nov 12 21:25:00 netbox php-fpm7.4[22507]: PHP: syntax error, unexpected END_OF_LINE, expecting '=' in Unknown on line 3
nov 12 21:25:00 netbox php-fpm7.4[22507]: [12-Nov-2020 21:25:00] ERROR: Unable to include /etc/php/7.4/fpm/pool.d/librenms.conf from /etc/php/7.4/fpm/php-fpm.conf at line 4
nov 12 21:25:00 netbox php-fpm7.4[22507]: [12-Nov-2020 21:25:00] ERROR: failed to load configuration file '/etc/php/7.4/fpm/php-fpm.conf'
nov 12 21:25:00 netbox php-fpm7.4[22507]: [12-Nov-2020 21:25:00] ERROR: FPM initialization failed
nov 12 21:25:00 netbox systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/n/a
nov 12 21:25:00 netbox systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
nov 12 21:25:00 netbox systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
I’v got it running after correcting the part i mentioned above. At one point i was able to log on but still hade notice saying that i need to upgrade php. My validate.php suggested to run daily.sh and it’s generating a lot of errors about database e.g. missing columns, extra index
Also error about timezone in php but it is set as mentioned in guide
I’m not sure what is going on but right now it is stuck at cleaning DB. i’ll let it run and see what happens
./validate.php has no output now
I’m using Ubuntu 18.04.
I very often get this error Undefined index: name at /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:122)
From what I’ve seen, it’s related to a bug with laravel/framework - illuminate/foundation (not sure what librenms uses) and composer.
Do do you guys have any clue ?
I have seen that too during my upgrade to 7.4 php.
After following the guide mentioned above and also running daily.sh afterwards, everything resolved. Dont know what happened. Daily.sh took several hours so i left it running over night.
Hope this helps somehow
Thanks for your answer.
I’m not sure what solved the issue because I’ve tested different fixes but it’s working now. That’s all matters lol
I just need to make my SSL certificate work again. Do you know what to change in the librenms.conf file (apache2) for the <VirtualHost *:443> ?
Steps work out well. However I notice that when I do some steps in " Add php7.4 libraries" I have to link python3 to python3.6 to get working. Our current setup is Ubuntu 18.04LTS using python3.8 and php7.2, so hopefully this can help out with those on the same setup as me. Unfortunately i have to downgrade to python3.6 from 3.8.To link python3 to python3.6 follow these steps:
cd /usr/bin/
rm python3
ln -s python3.6 python3
For me since Im using LDAP authentication I have to install php7.4 ldap after “Install php7.4” step
apt-get install php7.4-ldap
I notice after restarting the services I have to run these as well then it all came good
I highly suggest you use Python 3.8 over 3.6 with LibreNMS.
The error is probably because you have not install the libraries LibreNMS needs for 3.8, but they exist for 3.6. Install them and you won’t have to do silly things like run an old version of python.
These are wonderfully details steps.
However, since I’m running NGINX instead of Apache, any idea what steps would be needed for NGINX instead of Apache?
I join the question, I’m using the OVA image with ubuntu 18.04 from github, and that’s using nginx, and instructions to upgrade php are nowhere to be found…