Problem after upgrade to latest PHP (PHP Parse error - unexpected =

Hi, I upgraded to the latest PHP a few days ago (PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1) and since then when I try to go to the LibreNMS web page I get a 500 error.

./daily.php and ./validate.php return ok:

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

and

====================================

Component Version
LibreNMS 1.48.1-62-gfcb0b67
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1
MySQL 10.0.38-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Librenms.log is not reporting errors, but I do see these errors in error.log:

2019/02/16 09:47:43 [error] 1051#1051: *12 FastCGI sent in stderr: “PHP message: PHP Parse error: syntax error, unexpected ‘=’ in /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 388” while reading response header from upstream, client: 192.168.1.92, server: librenms.example.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm.sock:”, host: “librenms”

Any ideas?

https://community.librenms.org/t/issues-after-recent-php-version-updates/7222/4

Seems like your nginx conf still poiting php7.0-fpm instead the new 7.2

Thanks, I’d only seen the tail end of that thread. Problem 1 solved it. For anyone else seeing this, and you’re using nginx and php 7.2.

As root:

apt-get install php7-2-fpm

Then edit this file:

/etc/nginx/conf.d/librenms.conf

and change the following line:

fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

to

fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

Save it, then restart:

systemctl restart nginx