Page 1 of 1
Upgrade php to 7.4 on RedHat 8 question
Posted: Sun Jun 06, 2021 1:31 pm
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?
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Mon Jun 07, 2021 11:36 am
by ssax
Did you install through source/RPM/or offline?
What is the output of this command?
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Mon Jun 07, 2021 10:51 pm
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.
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Tue Jun 08, 2021 1:28 pm
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).
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Tue Jun 08, 2021 8:53 pm
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
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Wed Jun 09, 2021 2:03 pm
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
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Wed Jun 09, 2021 9:31 pm
by BenCowan
Ok, thanks guys. You can lock this one.
Re: Upgrade php to 7.4 on RedHat 8 question
Posted: Thu Jun 10, 2021 7:31 am
by scottwilkerson
BenCowan wrote:Ok, thanks guys. You can lock this one.
Locking thread