Installation PHP7.2 Ubuntu 16 problems

I have a broken LibreNMS enviroment now… I got the message of daily.sh about my PHP version to low and upgraded to PHP7.2 (on Ubuntu 16).

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

Component Version
LibreNMS 1.48.1-24-g318e485
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.2.14-1+0~20190205200805.15+stretch~1.gbpd83c69
MySQL 10.0.29-MariaDB-0ubuntu0.16.10.1
RRDTool 1.6.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.8.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] Missing PHP extension: gd
[FIX]:
Please install gd
[WARN] You are on the PHP 5.6/7.0 support branch, this will prevent automatic updates.
[FIX]:
Update to PHP 7.1.3 or newer (PHP 7.2 recommended) to continue to receive updates.
You have new mail in /var/mail/root
root@support:/opt/librenms# php -v
PHP 7.2.14-1+0~20190205200805.15+stretch~1.gbpd83c69 (cli) (built: Feb 5 2019 20:08:06) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.2.14-1+0~20190205200805.15+stretch~1.gbpd83c69, Copyright © 1999-2018, by Zend Technologies
root@support:/opt/librenms#

When installing php7.2-gd:

root@support:/opt/librenms# apt install php7.2-gd
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php7.2-gd : Depends: libjpeg62-turbo (>= 1.3.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
root@support:/opt/librenms#

Anyone know the issue? I cannot install libjpeg62-turbo because:

root@support:/opt/librenms# apt install libjpeg62-turbo
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libjpeg62-turbo is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libjpeg62-turbo’ has no installation candidate

Help would be appreciated!

Desmond

i think it’s still using your old php version, what does php -v say?

the turbo thing i don’t think will make much difference but it looks like it can resolved as follows: https://askubuntu.com/questions/921555/how-to-install-libjpeg62-turbo-on-ubuntu-16-04-2-lts-xenial/921822

What is the output when you run ./daily.sh?

root@support:/opt/librenms# php -v
PHP 7.2.14-1+0~20190205200805.15+stretch~1.gbpd83c69 (cli) (built: Feb 5 2019 20:08:06) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.14-1+0~20190205200805.15+stretch~1.gbpd83c69, Copyright (c) 1999-2018, by Zend Technologies
root@support:/opt/librenms# php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

root@support:/opt/librenms#

root@support:/opt/librenms# apt-get install libjpeg62-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
libjpeg62-dev is already the newest version (1:6b2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@support:/opt/librenms#

root@support:/opt/librenms# sh daily.sh
daily.sh: 96: daily.sh: Syntax error: “(” unexpected (expecting “}”)
root@support:/opt/librenms#

The error I see is:

Missing PHP extensions. Please install and enable them on your LibreNMS server.

gd

That is an odd error. What version of bash are you using?

root@support:/opt/librenms# bash -version
bash -version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright © 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Do you get the same result with /bin/bash daily.sh ?

Did you try to install the missing extension?

Did you disable your old php entirely? e.g https://www.rosehosting.com/blog/how-to-install-php-7-2-on-ubuntu-16-04/

Chas,

I see this:

root@support:/opt/librenms# /bin/bash daily.sh 
Re-running /opt/librenms/daily.sh as librenms user
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

But on my LibreNMS installation: https://monitor.serverion.com/

I followed your link at https://www.rosehosting.com/blog/how-to-install-php-7-2-on-ubuntu-16-04/ but still get the error on php7.2-gd:

root@support:/opt/librenms# apt-get install php7.2-gd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2-gd : Depends: libgd3 (>= 2.1.1) but it is not going to be installed
             Depends: libjpeg62-turbo (>= 1.3.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
root@support:/opt/librenms# 

My Validate is:

root@support:/opt/librenms# ./validate.php 
====================================
Component | Version
--------- | -------
LibreNMS  | 1.48.1-29-gbc93d8c
DB Schema | 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP       | 7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0
MySQL     | 10.0.29-MariaDB-0ubuntu0.16.10.1
RRDTool   | 1.6.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.8.3
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[FAIL]  Missing PHP extension: gd
        [FIX]: 
        Please install gd
root@support:/opt/librenms# 

And my php -m and php -v:

root@support:/opt/librenms# php -v
PHP 7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0 (cli) (built: Feb  9 2019 06:51:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.15-1+0~20190209065123.16+stretch~1.gbp3ad8c0, Copyright (c) 1999-2018, by                 
Zend Technologies
    root@support:/opt/librenms# php -m
PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib
[Zend Modules]
Zend OPcache

root@support:/opt/librenms# 

Bottomline is that php7.2-gd will not install due to libjpeg62-turbo.

Do I need libjpeg62-turbo?
How do I remove it?
Maybe upgrade to 7.3?

I have spend many hours filling my LibreNMS and now it is unavailable :frowning:

Yeh I don’t know if you need it but i’m guessing so,

How did you install 7.2 ? it’s possible your packages might be messed up , check what repo’s your using,

you could try, but i think you have already

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-gd

if all fails i would uninstall 7.2 completely, and try re-installing with a good php repo for ubuntu16

Yup, I have tried them all unfortunately… I think upgrading to 18.x will be an option or otherwise install CentOS 7.x and suppose all problems are gone…

yeh probably worth a try. it seems on 18.04 you will use universe repo: https://docs.librenms.org/Installation/Installation-Ubuntu-1804-Nginx/

Some others experienced some issues when upgrading just for info Upgrade ubuntu 16.04 to 18.04 - DB Issue

I have finally fixed it …

I removed all PHP versions and installed the old libjpeg62-turbo using dpkg… PHP7.2 installed fine and my Libre is back up. (Debian -- Package Download Selection -- libjpeg62-turbo_2.1.5-2+b2_amd64.deb)

Chas and Murrant, again thanks for the help again :slight_smile: have a good night!

1 Like