Home » Categories » Multiple Categories

Nagios XI - Upgrading To PHP 7


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+) | 7.3 (XI 5.6.8+) | 7.4 (XI 5.7.0+)

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.

NOTE: PHP Mailer requires PHP 5.6 or higher to use a TLS 1.2 connection.


Upgrading to PHP 7

NOTE: If you have an offline installation, follow the steps below and then proceed to the Offline Installations ONLY section.

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.

Must be using Nagios XI 5.5 or higher to upgrade to PHP 7.


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


RHEL 7 | CentOS 7 | Oracle Linux 7

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



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-php74
yum -y 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 php-pecl-ssh2 php-pgsql php-process php-snmp php-xml php-odbc
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
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


RHEL 7 | CentOS 7 | Oracle Linux 7

systemctl restart httpd


Offline Installations ONLY

Download this file and put it in /tmp:
Then run these commands as root:
cd /tmp
rm -rf /tmp/nagiosxi
tar zxf nagiosxi-X.X.X-X.elX.x86_64.tar.gz
cd nagiosxi
yum install -y nagiosxi-nagioscore-X.X.X-X.elX.x86_64.rpm nagiosxi-nagvis-X.X.X-X.elX.x86_64.rpm
rpm -i --noscripts --nodeps nagiosxi-X.X.X-X.elX.x86_64.rpm
systemctl restart nagios
Then apply configuration and validate.


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:


5 (1)
Article Rating (1 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
Nagios XI - Understanding the Nagios XI Directory Structure
Viewed 3393 times since Thu, Jan 28, 2016
Nagios XI - Disabling Database UTF8 Connectivity
Viewed 2520 times since Thu, Mar 8, 2018
Nagios XI - Mass Delete Old RRD Files
Viewed 2162 times since Tue, Sep 10, 2019
Nagios XI - How To Test Check Commands From The Command-line
Viewed 22477 times since Tue, Jan 26, 2016
Nagios XI - Connecting To Your Email Server
Viewed 2070 times since Wed, Jul 19, 2017
Nagios XI - Distributed Monitoring With NRDP
Viewed 3237 times since Thu, Aug 17, 2017
Nagios XI - Understanding Notification Escalations
Viewed 2746 times since Thu, Jan 28, 2016
Configuring Your Server With A Static IP Address
Viewed 39885 times since Tue, Oct 11, 2016
Converting PostgreSQL to MySQL for Nagios XI
Viewed 22408 times since Tue, Dec 6, 2016
Nagios XI - Virtual Machine Notes
Viewed 2972 times since Thu, Jan 28, 2016