upgrade to PHP 7.4 fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

upgrade to PHP 7.4 fails

Post by mon-team »

Hello,
i'm running Nagios XI 5.6.1 on a Centos 7.7.
Following this guide https://support.nagios.com/kb/article/n ... 7-860.html the PHP version is upgraded to the 7.4, but the main webpage is unavailable and i get an http code 500.
The apache error log says this:

PHP Fatal error: SourceGuardian Loader - This protected script was not encoded for version 7.4 of PHP

i followed the procedure step by step upgrading also to the latest sourceguardian.
Could you help me?
Regards
Francesco
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: upgrade to PHP 7.4 fails

Post by vtrac »

Hi Francesco,
How are you doing?
Based on the KB (below), you might want to use php-7.2 instead, since your XI is at "5.6.1".
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+)
https://support.nagios.com/kb/article/n ... 7-860.html


Since you already done the below steps, we can skip them:

Code: Select all

yum -y install epel-release wget
yum remove nagiosxi-deps* -y
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Now, please try the followings, install php72:

Code: Select all

yum -y remove php-*
yum-config-manager --disable remi-php74
yum-config-manager --enable remi-php72

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
./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
Please run the below command and make sure that "php-7.2" is listed:

Code: Select all

rpm -qa | grep "^php-"
Now, let reconfigure Nagios and restart services:

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

systemctl restart mariadb
systemctl restart httpd
systemctl restart nagios
Best Regards,
Vinh
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: upgrade to PHP 7.4 fails

Post by mon-team »

Hello Vihn,
yes i missed the information about my current release :roll:
I've followed the steps to install the php 7.2, and i confirm you that i've succesfully updated the php version.

Thanks for your clarification,
Regards
Francesco
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: upgrade to PHP 7.4 fails

Post by vtrac »

Great!! .... locking thread ... :-)
Locked