Missing PHP extensions on my LibreNMS

Got LibreNMS installed on Ubuntu 16.04.1 LTS and we recently patch it with the latest patches and it also got upgraded to 18.04.1 LTS. My GUI is now showing “Missing PHP extensions. Please install and enable them on your LibreNMS server. curl”

Validate my LibreNMS and it shows the following

/opt/librenms/validate.php

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0

Component Version
LibreNMS 1.45
DB Schema 270
PHP 7.0.30-0ubuntu0.16.04.1
MySQL 10.1.34-MariaDB-0ubuntu0.18.04.1
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

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

[OK] Composer Version: 1.7.3
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/curl.so’ - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
[FAIL] Missing PHP extension: curl
[FIX]:
Please install curl
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
bootstrap/cache/.gitignore
logs/.gitignore
rrd/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/debugbar/.gitignore
storage/framework/cache/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore

Install curl and it shows this:

sudo apt-get install curl

Reading package lists… Done
Building dependency tree
Reading state information… Done
curl is already the newest version (7.58.0-2ubuntu3.5).
The following packages were automatically installed and are no longer required:
fonts-ubuntu-font-family-console imagemagick-common libapol4 libbind9-140 libblas-common libdbus-glib-1-2 libdns162 libevtlog0 libgdbm3 libicu55
libisc160 libisccc140 libisccfg140 libjs-excanvas liblwres141 libmongo-client0 libqpol1 librrd4 libvpx3 lua-lpeg python-ipy python-setools
selinux-policy-default
Use ‘sudo apt autoremove’ to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

Appreciate any help to restore my LibreNMS. Ive got smokeping also installed on this same server and it still works fine

Thanks

What you need is the php curl extension.

As you are running php7.0, it should be something like sudo apt install php7.0-curl OR something similar. I’m not Ubuntu user.

Did you try to install the php-curl extension? Depend on php version should be:

$ sudo apt-get install php-curl
or
$ sudo apt-get install php7.0-curl

first look at which PHP version you have on your Ubuntu server.
apt list --installed | grep -i php

if all goes well you only see PHP and PHP 7.0 or PHP7.2 if you both have version 7 you have to delete 1.

I had a similar problem, but a little different after an update ubuntu version 18 and I removed PHP7.0.
see

Thanks @Svenman2 Ive removed PHP 7.0. When I validate now it is showing up with this:

[FAIL] You have no timezone set for php.
[FIX]:
http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
bootstrap/cache/.gitignore
logs/.gitignore
rrd/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/debugbar/.gitignore
storage/framework/cache/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore

Ive modified the .ini files with right timezone but still it doesn’t. Probably I’m missing something.

Can you give a full validate with PHP version.

Here are some things you can go after and can try if you have not already done so.
restart LibreNMS server or systemctl restart apache2.
reinstall PHP according to librenms install the correct ubuntu version! https://docs.librenms.org/Installation/
check date /etc/php/7.X/cli/php.ini and /etc/php/7.X/apache2/php.ini See example below (X is version)

[Date]
; Defines the default time zone used by the date functions
; http://php.net/date.timezone
  date.timezone = "Europe / Amsterdam"

hopefully you can do something with this and you can solve the problem. These are the steps I did last time.

|### Usaia Tawakevou <[email protected]>|7:21 AM (14 minutes ago)||

|
| — | — | — |
|to Ed

|

Its on 7.2.10 now

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

Component | Version

--------- | -------

LibreNMS | 1.45

DB Schema | 270

PHP | 7.2.10-0ubuntu0.18.04.1

MySQL | 10.1.34-MariaDB-0ubuntu0.18.04.1

RRDTool | 1.7.0

SNMP | NET-SNMP 5.7.3

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

[OK] Composer Version: 1.7.3

[OK] Dependencies up-to-date.

[OK] Database connection successful

[OK] Database schema correct

[FAIL] You have no timezone set for php.

    [FIX]:

PHP: Runtime Configuration - Manual

[WARN] Your local git contains modified files, this could prevent automatic updates.

    [FIX]:

    You can fix this with ./scripts/github-remove

    Modified Files:

     bootstrap/cache/.gitignore

     logs/.gitignore

     rrd/.gitignore

     storage/app/.gitignore

     storage/app/public/.gitignore

     storage/debugbar/.gitignore

     storage/framework/cache/.gitignore

     storage/framework/sessions/.gitignore

     storage/framework/testing/.gitignore

     storage/framework/views/.gitignore

     storage/logs/.gitignore

Ive also change the timezone however when I validate its still prompting me to fix my timezone

Modified the php.ini files in this folders:
/etc/php/7.2/fpm
/etc/php/7.2/cli
/etc/php/7.2/apache2

By the way this is the format in those php.ini file:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone = Pacific/Fiji

Sorry I fix the timezone issue by uncommenting that line :slight_smile: my bad. Now when I validate its just showing

You can fix this with ./scripts/github-remove

Nice so that it is solved with the help of me post :grinning: mark this topic that it is solved.
I just wanted to say look is my example you may have forgotten to remove the point coma.

that github report is also easy to solve see

Thanks @Svenman2. That fix my validation. However my GUI shows this - Whoops, looks like something went wrong. Check your librenms.log.

Went to that log file and it shows this

I have not had this error before, so for me this is also trying.

First try what is stated

  • Enable PHP LDAP (Google how to do this)
  • If that does not work find what LDAP package you need. and restart your service / server

If that does not work you have to create a new topic because this is a completely different problem than what you had first.

try this

Thank you so much @Svenman2. Got this fixed now with sudo apt-get install php7.2-ldap. Then of course, restart apache2 - systemctl restart apache2

Can now access my GUI

1 Like