502 Bad Gateway - Help with PHP 7.4

In response to the prompting I decided to upgrade from PHP 7.2 to 7.4 yesterday. I found this guide for folks on Ubuntu 18.04 and followed the steps, only to remember when I got to the last one that I’m running NGINX not Apache. D’oh. My last update ran in early November.

I went in search of install/upgrade instructions for NGINX but didn’t find a lot. The install guide for LibreNMS still lists PHP 7.2 but I did find this on Reddit.

https://www.reddit.com/r/LibreNMS/comments/jritf2/help_upgrade_to_php_74_issue_librenms_not_working/

I edited the file to match:

server {
listen 80;
server_name myserver.mydomain;
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 /api/v0 {
try_files $uri $uri/ /api_v0.php?$query_string;
}
location ~ [^/].php(/|$) {
fastcgi_pass unix:/run/php-fpm-librenms.sock;
fastcgi_split_path_info ^(.+.php)(/.+)$;
include fastcgi.conf;
}
location ~ /.ht {
deny all;
}

Pulled down master from git.

Still no luck. Rebooted. Ran /validate a couple times and fixed several things successively that it output.

sudo ln -s /opt/librenms/lnms /usr/local/bin/lnms
sudo cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
/opt/librenms/scripts/composer_wrapper.php install --no-dev

I’m now getting a warning about my database being out of date that says to run ./lnms migrate but I’m a bit nervous about losing all my data if something goes wrong there and I doubt it is causing the 502 error.

Any help is appreciated!

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