Home » Categories » Products » Nagios XI » Documentation » Advanced Topics

PHP 7.2 to 7.4 Upgrade Instructions for CentOS Stream 8

Purpose

This document is intended for use by Nagios Administrators who wish to update their version of php 7.2 to php 7.4 on a CentOS Stream 8 system or an EOL CentOS 8 system.

Enable CentOS 8 vault repos (For EOL CentOS 8 Only)

Since CentOS 8 is now EOL the supporting repos have been moved to CentOS’s vault area. We will need to enable these repos for the upgrade as follows:

 

mkdir /etc/yum.repos.d/old
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/old/

 

cat << \EOF > /etc/yum.repos.d/CentOS-vault.repo
[C8-BaseOS]
name=CentOS 8 - BaseOS
baseurl= https://vault.centos.org/8.5.2111/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
enabled=1
metadata_expire=never
[C8-AppStream]
name=CentOS 8 - AppStream
baseurl= https://vault.centos.org/8.5.2111/AppStream/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
enabled=1
metadata_expire=never
[powertools]
name=CentOS 8 - PowerTools
baseurl= https://vault.centos.org/8.5.2111/PowerTools/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
enabled=1
metadata_expire=never
EOF

 

cat << \EOF > /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
#baseurl= https://download.example/pub/epel/$releasever/Everything/$basearch
metalink= https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=0
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
EOF

 

PHP Upgrade process

From the command line on the XI server:

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module list php

 

Disable the 7.2 module that is enabled:

dnf module reset php:7.2
dnf module list php
dnf module enable php:remi-7.4
dnf 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
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

 

Edit /etc/php.ini and add 'extension=ixed.7.4.lin' directive (highlighted yellow):

  ;;;;;;;;;;;;;;;;;;;;;;

; Dynamic Extensions ;

;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following

; syntax:

;   extension=modulename

; For example:

;   extension=mysqli

;

; When the extension library to load is not located in the default extension

; directory, you may specify an absolute path to the library file:

;   extension=/path/to/extension/mysqli.so

;

; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and

; 'extension='php_<ext>.dll') is supported for legacy reasons and may be

; deprecated in a future PHP major version. So, when it is possible, please

; move to the new ('extension=<ext>) syntax.

;;;;

; Note: packaged extension modules are now loaded via the .ini files

; found in the directory /etc/php.d; these are loaded by default.

;;;;

; added for php 7.4

extension=ixed.7.4.lin

 

Save the /etc/php.ini.

Restart the server:

shutdown -r now


Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

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
Adding MATCH Statements in the SNMP Trap Interface
Viewed 5142 times since Fri, Jul 30, 2021
Nagios XI - Understanding Notification Variables
Viewed 8775 times since Thu, Jan 28, 2016
Nagios XI - Understanding Notification Escalations
Viewed 5965 times since Thu, Jan 28, 2016
Nagios XI - Scheduling Reports and Pages
Viewed 4617 times since Thu, Jan 28, 2016
Nagios Core - Nagios as a PC Health Monitor - NWC14
Viewed 11238 times since Tue, Feb 9, 2016
Nagios XI - Nagios Rapid Deployment Options - NWC14
Viewed 4915 times since Tue, Feb 9, 2016
Nagios XI - Integrating On-Call Schedules with Nagios - NWC13
Viewed 6438 times since Tue, Feb 9, 2016
Nagios XI - Custom Wizards, Components and Dashlets - NWC12
Viewed 9534 times since Thu, Feb 4, 2016
Nagios XI - Integrating autoIT With Nagios
Viewed 5771 times since Wed, Jan 27, 2016
Nagios XI - Group Deployment of Service Checks - NWC15
Viewed 7232 times since Mon, Feb 8, 2016