Upgrade PHP?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Upgrade PHP?

Post by vAJ »

My InfoSec engineer is telling me that our XI instances are not in PCI compliance after finding with the version of PHP running on the CentOS VM from the site.

Has anyone upgraded PHP successfully without any issues? Any knowledge to share in preparation for the upgrade?

System:

Nagios XI Version : 2012R2.1
localhost.localdomain 2.6.32-358.6.2.el6.x86_64 x86_64
CentOS release 6.4 (Final)
Gnome is not installed

Apache Information
PHP Version: 5.3.3
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade PHP?

Post by abrist »

We did run internal tests on php 5.4 and made the necessary changes for deprecated functions. You will need to upgrade php to 5.4 and XI to the latest version for 5.4 sourceguardian support. php 5.5 is not currently supported though.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Upgrade PHP?

Post by vAJ »

what were the changes made for deprecation?
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade PHP?

Post by abrist »

A handful of functions were causing breakage with 5.4. Those were updated to the newer functions/syntax.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Upgrade PHP?

Post by vAJ »

Ok. I'll do this on my test system and see what I get.
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade PHP?

Post by abrist »

Great, always test a big package upgrade like this before deployment. It worked in house here and we have not had any reports of issues with it, but you never know. That is why we offer the ability to run a live,backup, and test server from 1 nagios XI license. Let me know if you have issues.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Upgrade PHP?

Post by vAJ »

OK. Little hiccup here.

Getting the DBConnect error:

Code: Select all

DB Connect Error [nagiosxi]: Database connection failed
I've stopped MySQL, run repair script.

Restarted apache & pgsql.

apache error log shows:

Code: Select all

PHP Fatal error:  Call to undefined function pg_escape_string() in /usr/local/nagiosxi/html/includes/db.inc.php on line 329
I'm assuming I'm missing something in php.ini, but don't know what. Possibly need to recompile PHP?
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrade PHP?

Post by abrist »

What version of php did you upgrade to?

Code: Select all

yum list installed | grep php
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Upgrade PHP?

Post by vAJ »

5.4.16
Andrew J. - Do you even grok?
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Upgrade PHP?

Post by vAJ »

Weird, I compiled from scratch and PHPInfo shows 5.4.16, but yum shows:

Code: Select all

php.x86_64                            5.3.3-22.el6                     @base
php-cli.x86_64                        5.3.3-22.el6                     @base
php-common.x86_64                     5.3.3-22.el6                     @base
php-gd.x86_64                         5.3.3-22.el6                     @base
php-ldap.x86_64                       5.3.3-22.el6                     @base
php-mbstring.x86_64                   5.3.3-22.el6                     @base
php-mcrypt.x86_64                     5.3.3-1.el6.rf                   @rpmforge
php-mssql.x86_64                      5.3.3-1.el6                      @epel
php-mysql.x86_64                      5.3.3-22.el6                     @base
php-pdo.x86_64                        5.3.3-22.el6                     @base
php-pear.noarch                       1:1.9.4-4.el6                    @base
php-pear-HTML-Template-IT.noarch      1.3.0-2.el5                      @/php-pear-HTML-Template-IT-1.3.0-2.el5.noarch
php-pgsql.x86_64                      5.3.3-22.el6                     @base
php-snmp.x86_64                       5.3.3-22.el6                     @base
php-xml.x86_64                        5.3.3-22.el6                     @base
Andrew J. - Do you even grok?
Locked