Upgrade php to 7.4 on RedHat 8 question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
BenCowan
Posts: 68
Joined: Thu Jul 28, 2011 11:34 am

Upgrade php to 7.4 on RedHat 8 question

Post by BenCowan »

Our RedHat System Administrator wants me to upgrade php from 7.2 to 7.4, so I'm trying to understand the document, found here:

https://support.nagios.com/kb/article/n ... 7-860.html

I realize that I'll need to adapt it to RHEL 8, but the first step confuses me, so maybe I'm misunderstanding. Won't the following command uninstall much of Nagios XI, and destroy the installation?

dnf -y remove nagiosxi-deps*

Isn't there some way to enable 7.4 and run an update without doing this?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade php to 7.4 on RedHat 8 question

Post by ssax »

Did you install through source/RPM/or offline?

What is the output of this command?

Code: Select all

rpm -qa | grep nagiosxi
BenCowan
Posts: 68
Joined: Thu Jul 28, 2011 11:34 am

Re: Upgrade php to 7.4 on RedHat 8 question

Post by BenCowan »

[root@shire:/tmp/pg2mysql-master]# rpm -qa | grep nagiosxi
nagiosxi-deps-el8-5.8.3-1.noarch

I migrated from CentOS7 to RedHat8, this way:
1) wget latest XIversion, and ran ./fullintall
2) restored backup from CentOS XI onto RedHat XI

During the fullinstall, I seem to remember receiving a message that it wanted to install a php version less than 7.3, but I may have misinterpreted the meaning. I reset the module (dnf module reset php), and it installed 7.2.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Upgrade php to 7.4 on RedHat 8 question

Post by ssax »

I don't have access to a RHEL 8 system but I was able to do it on CENT 8 by doing this:

Code: Select all

yum -y install epel-release
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf -y install dnf-utils
sudo dnf -y module reset php
sudo dnf -y module install php:remi-7.4
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/xi-latest.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
systemctl restart httpd php-fpm
But you may want to reach out RHEL as they may have some special repo/proper instructions that you can use that has PHP 7.4 from an official RHEL repo (instead of 3rd party REMI).
BenCowan
Posts: 68
Joined: Thu Jul 28, 2011 11:34 am

Re: Upgrade php to 7.4 on RedHat 8 question

Post by BenCowan »

Thanks for that saxx! I went ahead and did this on my Test system, but I have questions and comments...

I take it that packages [php-imap php-pecl-ssh2] don't exist on RHEL8 or aren't supported anymore?

Also, what about the nagiosxi-deps repo? Do I need to do anything with that, at this point?

And, do you know how to make php 7.4 the default stream? or does it matter? See, output of module list below...

[root@shire:/var/lib/php]# dnf module list php
Updating Subscription Management repositories.
Last metadata expiration check: 0:22:25 ago on Tue 08 Jun 2021 06:29:15 PM PDT.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 [e] common [d] , devel, minimal PHP scripting language
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Upgrade php to 7.4 on RedHat 8 question

Post by vtrac »

Hi,
How are you doing?

I believe PHP 7.2 came as "default" for RHEL 8.
You need to enable "7.4" before doing the PHP install ... However, I believe you already done that since I see an "e" from one of your command outputs.

To enable the module stream run the following :
dnf module enable php:remi-7.4

Once the PHP remi-7.4 module has been enabled, you can then proceed and install PHP
dnf install php php-cli php-common

https://www.linuxtechi.com/install-php- ... -8-rhel-8/

Also, you don't need to do anything with nagiosxi-deps repo.

As to packages "php-imap" and "php-pecl-ssh2", please try the below command and see if there is/are any available package(s) to install:

Code: Select all

yum search ssh2
yum search php-imap
Best Regards,
Vinh
BenCowan
Posts: 68
Joined: Thu Jul 28, 2011 11:34 am

Re: Upgrade php to 7.4 on RedHat 8 question

Post by BenCowan »

Ok, thanks guys. You can lock this one.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Upgrade php to 7.4 on RedHat 8 question

Post by scottwilkerson »

BenCowan wrote:Ok, thanks guys. You can lock this one.
Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked