Page 1 of 1

Upgrade PHP from 7.2 to 7.3

Posted: Wed Apr 28, 2021 9:17 am
by vornado
Good morning, all.

This morning I received this warning when update our Nagios server (CentOS 7):

1 =====================================================================
2
3 WARNING : PHP 7.2 have reached its "End of Life" in
4 November 2020. Even, if this package includes some of
5 the important security fix, backported from 7.3, the
6 UPGRADE to a maintained version is very strongly RECOMMENDED.
7
8 =====================================================================

I found a Nagios Support Knowledgebase article with instructions to upgrade to PHP 7.2, which is what we have.

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

Looking at the steps in this article, it looks like some might not be necessary. Are there instructions available specifically to upgrade from PHP 7.2 to 7.3?

Thanks in advance for your usual prompt response.

Steve

Re: Upgrade PHP from 7.2 to 7.3

Posted: Wed Apr 28, 2021 5:03 pm
by benjaminsmith
Hi,

The process is similar but you'll want to enable the repo for 7.3 and disable the other. I tested this and it worked for me but please take a VM snapshot and/or take a full backup before making any changes, or preferably run through this on a test instance before updating the production server.

Code: Select all

sudo yum-config-manager --disable remi-php72
sudo yum-config-manager --enable remi-php73
Then update the system.

Code: Select all

yum update
Re-install the Source Guardian PHP extension.

Code: Select all

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
Then restart the web server.

Code: Select all

systemctl restart httpd
Let me know if you need help or have any questions.

References:
https://tecadmin.net/install-php7-on-centos7/
https://stackoverflow.com/questions/619 ... -on-centos

Re: Upgrade PHP from 7.2 to 7.3

Posted: Thu Apr 29, 2021 6:36 am
by techgeek
This is an interesting thread and I see php v8 is out since last November - will NagiosXI work if we upgrade to that or is it safer to saty on 7.3 or 7.4?

Re: Upgrade PHP from 7.2 to 7.3

Posted: Thu Apr 29, 2021 10:11 am
by benjaminsmith
Hi techgeek,

We haven't rolled out support for PHP 8 yet, it's unlikely to work by default. We usually need to adjust some to the other packages/settings for major updates.

--Benjamin

Re: Upgrade PHP from 7.2 to 7.3

Posted: Fri Apr 30, 2021 5:35 am
by techgeek
Thanks that is good to know - does Nagiosxi work with 7.4?

Re: Upgrade PHP from 7.2 to 7.3

Posted: Fri Apr 30, 2021 9:51 am
by dchurch
Good question. Yes, Nagios XI will run in PHP 7.4 as long as you're using Nagios XI 5.7.0 or later.

Supported PHP versions for Nagios XI:
  • 5.3, 5.4, 5.5, 5.6
  • 7.0, 7.1, 7.2 (XI 5.5+)
  • 7.3 (XI 5.6.8+)
  • 7.4 (XI 5.7.0+)

Re: Upgrade PHP from 7.2 to 7.3

Posted: Wed May 26, 2021 10:17 am
by vornado
Sorry I didn't reply sooner -- the upgrade went well. Thanks for your help!

Steve

Re: Upgrade PHP from 7.2 to 7.3

Posted: Wed May 26, 2021 10:27 am
by dchurch
Glad to hear you resolved it! Locking thread.

If you have any additional issues, feel free to make a new thread.