Home » Categories » Multiple Categories

Nagios XI - Upgrading To PHP 7

Overview


This document describes how to upgrade to PHP 7 on RHEL, CentOS and Oracle Linux systems. Nagios XI is compatible with the following versions of PHP.

5.3, 5.4, 5.5, 5.6 | 7.0, 7.1, 7.2 (XI 5.5+)

For performing installations and upgrades, Nagios XI uses the version of PHP provided by the operating system vendor such as RHEL, CentOS and Oracle Linux. For security and stability, we recommend and support the version of PHP provided by operating system vendor.

To mitigate security vulnerabilities and avoid backward compatibility issues, operating system vendors have a process known as backporting. Here's how it works: RHEL patches the supported versions of these packages with the security fixes from the newer versions of these packages. For example, they will take the code from PHP 7.2 and apply the security vulnerability fix to the version of PHP provided by their repositories such as 5.4.x.

 

Upgrading to PHP 7


If your company environment requires upgrading to PHP 7.x, please follow the commands below. These steps have been created to minimize upgrade or system failures due to PHP package incompatibilities.

All

yum -y install epel-release wget
yum remove nagiosxi-deps* -y

 

RHEL 6 | CentOS 6 | Oracle Linux 6

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

 

RHEL 7 | CentOS 7 | Oracle Linux 7

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm

 

All

yum -y install yum-utils
PHPTZ=$(grep -s '^date.timezone' /etc/php.ini | awk '{print $3}')
yum -y remove php-*
yum-config-manager --enable remi-php72
yum -y install php php-opcache php-devel php-gd php-ldap php-mbstring php-pdo php-mysqlnd php-pgsql php-pear php-pecl-ssh2 php-pgsql php-process php-snmp php-xml
sed -i "s:;date.timezone =.*:date.timezone = ${PHPTZ}:" /etc/php.ini
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

 

RHEL 6 | CentOS 6 | Oracle Linux 6

service httpd restart

 

RHEL 7 | CentOS 7 | Oracle Linux 7

systemctl restart httpd

 

Once completed you should login to Nagios XI and test everything is working OK. A system reboot is also recommended.

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How To Download Files From The Nagios Exchange Using WGET
Viewed 2736 times since Tue, Aug 2, 2016
Nagios XI - Integrating On-Call Schedules with Nagios - NWC13
Viewed 1221 times since Tue, Feb 9, 2016
Nagios XI - Distributed Monitoring With NRDP
Viewed 1267 times since Thu, Aug 17, 2017
Nagios XI - Importing Config Files From Nagios Core into Nagios XI
Viewed 2733 times since Wed, Jan 27, 2016
Nagios XI - SNMP Trap v3 Configuration
Viewed 6039 times since Tue, Nov 13, 2018
Nagios XI - Checking System Status
Viewed 1206 times since Wed, Jul 19, 2017
Nagios XI - Optimizing The PHP Settings File
Viewed 2598 times since Thu, Jul 13, 2017
Nagios XI - Using The Config Import Prep Tool
Viewed 2011 times since Thu, Jan 28, 2016
Nagios XI - Using the Negate Plugin
Viewed 1507 times since Thu, Jan 28, 2016
Nagios XI - Redundancy And Security Planning
Viewed 783 times since Sun, Mar 25, 2018