PHP Fatal error - SourceGuardian Loader

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

PHP Fatal error - SourceGuardian Loader

Post by CWSI »

Hi guys,

Last week I upgraded our NagiosXI from 2014R2.7 to latest available version (5.6.2). Quite a few snags during the upgrade, but all solvable via old posts and FAQs on the site.

Next I upgraded PHP on the server from 5.2 to 7.3.5. Following the PHP upgrade, I noticed some errors about SourceGuardian being the incorrect version. So I downloaded ixed7.3 and updated /etc/php.d/sourceguardian.ini with "extension=ixed.7.3.lin". PHP errors went away and I thought all was good.

However I've just tried to login to the XI GUI, I get to https://nagiosxi.ourdomain.com but when I click "Access Nagios XI" I get directed to https://nagiosxi.ourdomain.com/nagiosxi and get a HTTP500 error. /var/log/httpd/ssl_error_log shows the following error -

Code: Select all

PHP Fatal error:  SourceGuardian Loader - This protected script was not encoded for version 7.3.5 of PHP. Please re-encode or contact the author of the script regarding this problem. Error code [07] in /usr/local/nagiosxi/html/includes/dbl.inc.php on line 2
Any suggestions please? Have I killed it :D?


Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP Fatal error - SourceGuardian Loader

Post by scottwilkerson »

This explains how to upgrade to the latest SG loaders
https://support.nagios.com/kb/article/n ... s-816.html
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

Re: PHP Fatal error - SourceGuardian Loader

Post by CWSI »

Hey Scott, thanks for coming back to me and sorry for not responding sooner, I didn't notice your reply!

Just tried that process but after a reboot still getting the same errors. The process didn't go too smoothly though, errors below -

Code: Select all

[root@uptime ~]# cd /tmp
[root@uptime tmp]# rm -rf nagiosxi xi*
[root@uptime tmp]# wget https://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
[root@uptime tmp]# tar xzf xi-latest.tar.gz
[root@uptime tmp]# cd nagiosxi

[root@uptime nagiosxi]# ./init.sh
PHP Warning:  Module 'SourceGuardian' already loaded in Unknown on line 0
PHP Fatal error:  SourceGuardian Loader - This protected script was not encoded for version 7.3.5 of PHP. Please re-encode or contact the author of the script regarding this problem. Error code [07] in /usr/local/nagiosxi/html/includes/dbl.inc.php on line 2

[root@uptime nagiosxi]# sed -i '/^PHP script/d' xi-sys.cfg
[root@uptime nagiosxi]# sed -i '/^1)/d' xi-sys.cfg
[root@uptime nagiosxi]# sed -i '/^2)/d' xi-sys.cfg
[root@uptime nagiosxi]# sed -i '/^3)/d' xi-sys.cfg

[root@uptime nagiosxi]# ./install-sourceguardian-extension.sh
PHP Warning:  Module 'SourceGuardian' already loaded in Unknown on line 0
Archive:  sourceguardian/ixed4.lin.x86-64.zip
caution: filename not matched:  ixed.7.3.lin
One note here; I did update SourceGuardian "manually" in-case that is causing an issue here. Basically just downloading the module and editing /etc/php.d/sourceguardian.ini.


Also wonder if I could suggest that you add the wording of the errors we're likely to see if the SourceGuardian Loaders need to be updated to that KB article? I spent quite a bit of time Googling and looking on nagios.com for the fix to this, to save having to hassle you with a suppot request, but mainly searching using the error message, but did not stumble across the KB. Would have got me to a solution quicker and save you having to reply to this :).
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP Fatal error - SourceGuardian Loader

Post by scottwilkerson »

I just re-read your OP, and we only support PHP <= 7.2

php 7.3.x is not supported yet.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

Re: PHP Fatal error - SourceGuardian Loader

Post by CWSI »

Ah, that might do it :D.

First question is when do you expect to support 7.3, just in-case there's a release in the coming days that I could jump to?

Secondly, any chance you could make this clear in some of the NagiosXI documentation? Searching for system requirements makes no mention of PHP versions. The only thing I came across was this thread - https://support.nagios.com/forum/viewto ... =6&t=53500 where one of the Nagios team seem to imply that the version of PHP is out of your control and perhaps not important to you (my fault for reading a little too much into it to be fair!). Again though it would save me wasting your time with this thread, and would have saved me some downtime and lot of Googling to find answers :).

Cheers
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP Fatal error - SourceGuardian Loader

Post by scottwilkerson »

CWSI wrote:First question is when do you expect to support 7.3, just in-case there's a release in the coming days that I could jump to?
It will likely be several months
CWSI wrote:Secondly, any chance you could make this clear in some of the NagiosXI documentation? Searching for system requirements makes no mention of PHP versions. The only thing I came across was this thread - viewtopic.php?f=6&t=53500 where one of the Nagios team seem to imply that the version of PHP is out of your control and perhaps not important to you (my fault for reading a little too much into it to be fair!). Again though it would save me wasting your time with this thread, and would have saved me some downtime and lot of Googling to find answers :).
Yes, I will get it added here today
https://assets.nagios.com/downloads/nag ... lation.php
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

Re: PHP Fatal error - SourceGuardian Loader

Post by CWSI »

Thanks Scott.

Turned out downgrading PHP to 7.2 was much easier than expected and I was able to upgrade the SourceGuardian protected scripts etc. afterward.

Thanks for the help!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PHP Fatal error - SourceGuardian Loader

Post by scottwilkerson »

CWSI wrote:Thanks Scott.

Turned out downgrading PHP to 7.2 was much easier than expected and I was able to upgrade the SourceGuardian protected scripts etc. afterward.

Thanks for the help!
Great!

Glad it is resolved!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked