Some errors on php upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Some errors on php upgrade

Post by gsmith »

Hi

Please send us the following files:

Code: Select all

/usr/local/nagiosxi/etc/xi-sys.cfg
/etc/php.ini
Also please provide the output of running the following from the CLI on the XI server:
ls -l /etc/php.d/sourceguardian.ini

Thank you
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Some errors on php upgrade

Post by DonForigua »

Hi dear Smith

Here is my files
[root@NAGIOSAPP ~]# ls -l /etc/php.d/sourceguardian.ini
-rw-r--r-- 1 root root 23 Feb 4 21:26 /etc/php.d/sourceguardian.ini
You do not have the required permissions to view the files attached to this post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Some errors on php upgrade

Post by gsmith »

Hi

Looking at your php.ini I see you missed adding the following (from my 22 March post):

Code: Select all

; added for php 7.4
extension=ixed.7.4.lin
Please add that and double-check what I posted on March 22:
dnf install https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module list php

Disable the 7.2 module that is enabled:
dnf module reset php:7.2
dnf module list php
dnf module enable php:remi-7.4
dnf install php php-imap php-opcache php-devel php-gd php-ldap php-mbstring php-pdo php-pdo-dblib php-mysqlnd php-pgsql php-pear
sed -i "s:;date.timezone =.*:date.timezone = ${PHPTZ}:" /etc/php.ini
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nag ... est.tar.gz
tar zxf xi-latest.tar.gz
cd /tmp/nagiosxi
rm -rf /etc/php.d/sourceguardian.ini
./init.sh
sed -i '/^PHP script/d' xi-sys.cfg
sed -i '/^1)/d' xi-sys.cfg
sed -i '/^2)/d' xi-sys.cfg
sed -i '/^3)/d' xi-sys.cfg
./install-sourceguardian-extension.sh


Edit /etc/php.ini and add 'extension=ixed.7.4.lin' directive
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename
;
; For example:
;
; extension=mysqli
;
; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
; extension=/path/to/extension/mysqli.so
;
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.

;;;;
; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
;;;;
; added for php 7.4
extension=ixed.7.4.lin


Restart the server
shutdown -r now
I didn't check the xi-sys.cfg file, but once you follow the above instructions let me know how things go.

Thanks
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Some errors on php upgrade

Post by DonForigua »

Hi dear Smith

But i see that this extension is here

Code: Select all

[root@NAGIOSAPP ~]#  cat /etc/php.d/sourceguardian.ini
extension=ixed.7.4.lin
[root@NAGIOSAPP ~]# ls -al /etc/php.d | grep source
-rw-r--r--    1 root root    23 Feb  4 21:26 sourceguardian.ini
must also i add to /etc/php.ini ?

Thanks for your help
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Some errors on php upgrade

Post by gsmith »

Hi

Yes.

Please perform the following in a command line on the server:

Code: Select all

script /tmp/nagios_support.log
dnf module reset php:7.2
dnf module list php
dnf module enable php:remi-7.4
dnf install php php-imap php-opcache php-devel php-gd php-ldap php-mbstring php-pdo php-pdo-dblib php-mysqlnd php-pgsql php-pear
sed -i "s:;date.timezone =.*:date.timezone = ${PHPTZ}:" /etc/php.ini
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nag ... est.tar.gz
tar zxf xi-latest.tar.gz
cd /tmp/nagiosxi
rm -rf /etc/php.d/sourceguardian.ini
./init.sh
sed -i '/^PHP script/d' xi-sys.cfg
sed -i '/^1)/d' xi-sys.cfg
sed -i '/^2)/d' xi-sys.cfg
sed -i '/^3)/d' xi-sys.cfg
./install-sourceguardian-extension.sh
exit
Send me the following files:
/tmp/nagios_support.log
/usr/local/nagiosxi/etc/xi-sys.cfg
/etc/php.ini

Thanks
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Some errors on php upgrade

Post by DonForigua »

Hi dear Smith

why should i reinstall php if i alrready have it

Code: Select all

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name         Stream               Profiles                          Summary
php          remi-7.2             common [d], devel, minimal        PHP scripting language
php          remi-7.3             common [d], devel, minimal        PHP scripting language
php          remi-7.4 [e]         common [d], devel, minimal        PHP scripting language
php          remi-8.0             common [d], devel, minimal        PHP scripting language
php          remi-8.1             common [d], devel, minimal        PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
[root@NAGIOSAPP ~]# php -v
PHP 7.4.28 (cli) (built: Feb 15 2022 13:23:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
and the timezone is correct

Code: Select all

[root@NAGIOSAPP ~]# cat /etc/php.ini | grep date.timezone
; http://php.net/date.timezone
date.timezone = America/Bogota
and all packages are installed

Code: Select all

[root@NAGIOSAPP ~]# rpm -qa | egrep '^php' | sort
php-7.4.28-1.el8.remi.x86_64
php-cli-7.4.28-1.el8.remi.x86_64
php-common-7.4.28-1.el8.remi.x86_64
php-devel-7.4.28-1.el8.remi.x86_64
php-fedora-autoloader-1.0.1-2.el8.remi.noarch
php-fpm-7.4.28-1.el8.remi.x86_64
php-gd-7.4.28-1.el8.remi.x86_64
php-imap-7.4.28-1.el8.remi.x86_64
php-json-7.4.28-1.el8.remi.x86_64
php-ldap-7.4.28-1.el8.remi.x86_64
php-mbstring-7.4.28-1.el8.remi.x86_64
php-mysqlnd-7.4.28-1.el8.remi.x86_64
php-odbc-7.4.28-1.el8.remi.x86_64
php-opcache-7.4.28-1.el8.remi.x86_64
php-pdo-7.4.28-1.el8.remi.x86_64
php-pdo-dblib-7.4.28-1.el8.remi.x86_64
php-pear-1.10.13-1.el8.remi.noarch
php-pecl-mysql-1.0.0-0.23.20190415.d7643af.el8.remi.7.4.x86_64
php-pecl-ssh2-1.3.1-1.el8.remi.7.4.x86_64
php-pgsql-7.4.28-1.el8.remi.x86_64
php-process-7.4.28-1.el8.remi.x86_64
php-snmp-7.4.28-1.el8.remi.x86_64
php-sodium-7.4.28-1.el8.remi.x86_64
php-xml-7.4.28-1.el8.remi.x86_64
:shock: :shock:
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Some errors on php upgrade

Post by gsmith »

Did you run:
dnf module reset php:7.2

Did you re-install sourceguardian?
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nag ... est.tar.gz
tar zxf xi-latest.tar.gz
cd /tmp/nagiosxi
rm -rf /etc/php.d/sourceguardian.ini
./init.sh
sed -i '/^PHP script/d' xi-sys.cfg
sed -i '/^1)/d' xi-sys.cfg
sed -i '/^2)/d' xi-sys.cfg
sed -i '/^3)/d' xi-sys.cfg
./install-sourceguardian-extension.sh


Thanks
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Some errors on php upgrade

Post by DonForigua »

Hello

Yes, i followed this instructions

https://support.nagios.com/kb/article/n ... 7-860.html
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Some errors on php upgrade

Post by gsmith »

Hi

Please take a look at the attached screen capture. Then perform the
same actions on your system - and capture any errors that occur.

Thank you
You do not have the required permissions to view the files attached to this post.
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Some errors on php upgrade

Post by DonForigua »

Hello i've tried to replicate and i get the same error
You do not have the required permissions to view the files attached to this post.
Locked