Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo

Receiving the following messing in my web browser when trying to access the login page of my LibreNMS server:

Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo.

Fileinfo was missing from the system and I downloaded, compiled, and installed it as well as configure it as an extension in my php.ini file but still won’t load the login page. The server is still doing discoveries and sending email alerts, it just won’t display the website. Running PHP 7.3.20 on RHEL7. I ran the command 'composer show -p and it shows that the fileinfo module is installed and recoginzed. The ./validate and ./daily scripts output errors Can anyone assist?

bash-4.2$ ./validate.php
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0

Component Version
LibreNMS 1.70.1
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.3.20
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.7.1
SNMP NET-SNMP 5.7.2
OpenSSL

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

[OK] Composer Version: 2.0.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
[WARN] Global lnms shortcut not installed. lnms command must be run with full path
[FIX]:
sudo ln -s /nms/librenms/lnms /usr/local/bin/lnms
[FAIL] We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
[FIX]:
sudo chown -R librenms:librenms /nms/librenms
sudo setfacl -d -m g::rwx /nms/librenms/rrd /nms/librenms/logs /nms/librenms/bootstrap/cache/ /nms/librenms/storage/
sudo chmod -R ug=rwX /nms/librenms/rrd /nms/librenms/logs /nms/librenms/bootstrap/cache/ /nms/librenms/storage/
Files:
/nms/librenms/mirror

bash-4.2$ ./daily.sh
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
Fetching new release information OK
Updating to latest release OK
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

bash-4.2$ php --ini
PHP Warning: Module ‘fileinfo’ already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/opt/rh/rh-php73
Loaded Configuration File: /etc/opt/rh/rh-php73/php.ini
Scan for additional .ini files in: /etc/opt/rh/rh-php73/php.d
Additional .ini files parsed: /etc/opt/rh/rh-php73/php.d/20-bz2.ini,
/etc/opt/rh/rh-php73/php.d/20-calendar.ini,
/etc/opt/rh/rh-php73/php.d/20-ctype.ini,
/etc/opt/rh/rh-php73/php.d/20-curl.ini,
/etc/opt/rh/rh-php73/php.d/20-dom.ini,
/etc/opt/rh/rh-php73/php.d/20-exif.ini,
/etc/opt/rh/rh-php73/php.d/20-fileinfo.ini,
/etc/opt/rh/rh-php73/php.d/20-ftp.ini,
/etc/opt/rh/rh-php73/php.d/20-gd.ini,
/etc/opt/rh/rh-php73/php.d/20-gettext.ini,
/etc/opt/rh/rh-php73/php.d/20-iconv.ini,
/etc/opt/rh/rh-php73/php.d/20-json.ini,
/etc/opt/rh/rh-php73/php.d/20-mbstring.ini,
/etc/opt/rh/rh-php73/php.d/20-mysqlnd.ini,
/etc/opt/rh/rh-php73/php.d/20-pdo.ini,
/etc/opt/rh/rh-php73/php.d/20-phar.ini,
/etc/opt/rh/rh-php73/php.d/20-posix.ini,
/etc/opt/rh/rh-php73/php.d/20-shmop.ini,
/etc/opt/rh/rh-php73/php.d/20-simplexml.ini,
/etc/opt/rh/rh-php73/php.d/20-sockets.ini,
/etc/opt/rh/rh-php73/php.d/20-sqlite3.ini,
/etc/opt/rh/rh-php73/php.d/20-sysvmsg.ini,
/etc/opt/rh/rh-php73/php.d/20-sysvsem.ini,
/etc/opt/rh/rh-php73/php.d/20-sysvshm.ini,
/etc/opt/rh/rh-php73/php.d/20-tokenizer.ini,
/etc/opt/rh/rh-php73/php.d/20-xml.ini,
/etc/opt/rh/rh-php73/php.d/20-xmlwriter.ini,
/etc/opt/rh/rh-php73/php.d/20-xsl.ini,
/etc/opt/rh/rh-php73/php.d/20-zip.ini,
/etc/opt/rh/rh-php73/php.d/30-mysqli.ini,
/etc/opt/rh/rh-php73/php.d/30-pdo_mysql.ini,
/etc/opt/rh/rh-php73/php.d/30-pdo_sqlite.ini,
/etc/opt/rh/rh-php73/php.d/30-wddx.ini,
/etc/opt/rh/rh-php73/php.d/30-xmlreader.ini

Here’s the contents of my php.ini file

more php.ini | grep extension
; Directives are variables used to configure PHP or PHP extensions.
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants after the line that loads the extension.
; encodings. To use this feature, mbstring extension must be enabled.
; leading ‘/’. You must also specify the file extension being used including
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = “./”
;extension_dir = “ext”
; If you wish to have an extension loaded automatically, use the following
; extension=modulename
; extension=mysqli
; When the extension library to load is not located in the default extension
; exextension=fileinfo
;extension=/opt/rh/rh-php73/root/usr/lib64/php/modules/fileinfo.so
; Directory pointing to SQLite3 extensions
; http://phtension=/path/to/extension/mysqli.so
; Note : The syntax used in previous PHP versions (‘extension=.so’ and
; 'extension=‘php_.dll’) is supported for legacy reasons and may be
; move to the new ('extension=) syntax.
; Note: packaged extension modules are now loaded via the .ini files
;extension=/usr/lib64/php/modules/fileinfo
p.net/sqlite3.extension-dir
;sqlite3.extension_dir =
; Records communication from all extensions using mysqlnd to the specified log
; Sets the directory name where SOAP extension will put cache files.

; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
;;;;
;extension=/usr/lib64/php/modules/fileinfo
extension=fileinfo
;extension=/opt/rh/rh-php73/root/usr/lib64/php/modules/fileinfo.so

If i comment out the extension=fileinfo in my php.ini file then ./validate and ./daily look fine but i still get the same message when loading the webpage with Google Chrome; If i load it with Internet Explorer then I receive an HTTP 500 error

bash-4.2$ ./daily.sh
Fetching new release information OK
Updating to latest release OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
bash-4.2$
bash-4.2$
bash-4.2$
bash-4.2$ ./validate.php

Component Version
LibreNMS 1.70.1
DB Schema 2020_11_02_164331_add_powerstate_enum_to_vminfo (191)
PHP 7.3.20
Python 3.6.8
MySQL 5.5.68-MariaDB
RRDTool 1.7.1
SNMP NET-SNMP 5.7.2
OpenSSL

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

[OK] Composer Version: 2.0.8
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Global lnms shortcut not installed. lnms command must be run with full path
[FIX]:
sudo ln -s /nms/librenms/lnms /usr/local/bin/lnms

HTTP 500 Internal Server Error

# The website cannot display the page
HTTP 500
### Most likely causes:
  • The website is under maintenance.
  • The website has a programming error.|
    ||## What you can try:|
    ||####

[Refresh the page.](javascript:clickRefresh())Refresh the page.|
||####

[Go back to the previous page.](javascript:history.back();)Go back to the previous page.|
||####

More information [More information](javascript:expandCollapse(‘infoBlockID’, true):wink: More information

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.|

You need to check your webserver logs and librenms logs to see what could be causing the 500 error.

logs are indicating no issues…just the following message in my browsers:

Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo.

but fileinfo extension is installed…this is frustrating…

/var/log/htttpd/access_log shows this for Chrome/Firefox/IE:

[root@hqlx-prd-nms-01 httpd]# tail -f access_log
10.254.147.67 - - [17/Jan/2021:11:25:11 -0500] “GET /overview HTTP/1.1” 500 136 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36”
10.254.147.67 - - [17/Jan/2021:11:25:12 -0500] “GET /favicon.ico HTTP/1.1” 200 15086 “http://hqlx-prd-nms-01/overview” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36”
10.254.149.163 - - [19/Jan/2021:09:33:28 -0500] “GET / HTTP/1.1” 500 136 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36”
10.254.149.163 - - [19/Jan/2021:09:34:20 -0500] “-” 408 - “-” “-”
10.254.149.163 - - [19/Jan/2021:09:34:20 -0500] “-” 408 - “-” “-”
10.254.149.163 - - [19/Jan/2021:10:45:37 -0500] “GET / HTTP/1.1” 500 136 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36”
10.254.149.163 - - [19/Jan/2021:10:46:16 -0500] “GET / HTTP/1.1” 500 136 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0”
10.254.149.163 - - [19/Jan/2021:10:46:28 -0500] “-” 408 - “-” “-”
10.254.149.163 - - [19/Jan/2021:10:46:43 -0500] “GET / HTTP/1.1” 500 136 “-” “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; InfoPath.3; wbx 1.0.0; wbxapp 1.0.0; Zoom 3.6.0)”

/var/log/httpd/error_log shows:

[Tue Jan 19 09:33:28.699099 2021] [php7:error] [pid 5404] [client 10.254.149.163:9897] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo. in /nms/librenms/vendor/composer/platform_check.php on line 47
[Tue Jan 19 10:45:37.255274 2021] [php7:error] [pid 5400] [client 10.254.149.163:1108] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo. in /nms/librenms/vendor/composer/platform_check.php on line 47
[Tue Jan 19 10:46:16.450943 2021] [php7:error] [pid 5401] [client 10.254.149.163:1165] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo. in /nms/librenms/vendor/composer/platform_check.php on line 47
[Tue Jan 19 10:46:43.580316 2021] [php7:error] [pid 5404] [client 10.254.149.163:1265] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo. in /nms/librenms/vendor/composer/platform_check.php on line 47

Well it’s not activated for the php running in apache then. Normally it’s not the same config file as for the cli version.

Hello,

It is activated in my apache config file (/etc/httpd/conf/httpd.conf) this on RHEL7:

DirectoryIndex: sets the file that Apache will serve if a directory

is requested.

DirectoryIndex index.html index.php

I found this file www.conf in /etc/php-fpm.d/ and found a php section but not sure if anything in this section would be the cause (the php-fpm service is running):

; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call ‘ini_set’.
; php_admin_value/php_admin_flag - these directives won’t be overwritten by
; PHP call ‘ini_set’
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining ‘extension’ will load the corresponding shared extension from
; extension_dir. Defining ‘disable_functions’ or ‘disable_classes’ will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M

; Set session path to a directory owned by process user
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session

when i view php-fpm service status i get the error below:

[root@hqlx-prd-nms-01 php-fpm.d]# systemctl status php-fpm.service -l
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2021-01-15 12:27:23 EST; 4 days ago
Main PID: 15660 (php-fpm)
Status: “Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec”
CGroup: /system.slice/php-fpm.service
├─15660 php-fpm: master process (/etc/php-fpm.conf
├─15667 php-fpm: pool www
├─15668 php-fpm: pool www
├─15669 php-fpm: pool www
├─15670 php-fpm: pool www
└─15671 php-fpm: pool www

Jan 15 12:27:22 hqlx-prd-nms-01 systemd[1]: Starting The PHP FastCGI Process Manager…
Jan 15 12:27:23 hqlx-prd-nms-01 php-fpm[15660]: [15-Jan-2021 12:27:23] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/fileinfo’ - /usr/lib64/php/modules/fileinfo: cannot open shared object file: No such file or directory in Unknown on line 0
Jan 15 12:27:23 hqlx-prd-nms-01 systemd[1]: Started The PHP FastCGI Process Manager.

That is odd as I don’t think I even have fileinfo enabled for my php installs.

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