PHP broke after Core3 to Core4 and php5 to php7 upgrade

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
darthnul
Posts: 3
Joined: Wed Jan 16, 2019 1:57 pm

PHP broke after Core3 to Core4 and php5 to php7 upgrade

Post by darthnul »

Last month I upgraded from Nagios core 3 To Core 4.2 and from php5.6 to 7.2 running on FreeBSD 11.2. After commenting a few deprecated lines from nagios.cfg all seemed well. Last night I rebooted the server and Nagios started running but the web interface was not available. Apache 2.4 failed to start due to a couple of PHP related lines in httpd.conf that it didn't understand. I commented those out and httpd started but no joy on PHP pages.

It seems php5.6 continued to run in memory after the upgrade and apache/nagios happily used it until the reboot. Can anyone direct me to docs on what I need to reconfigure to get a config created for php5 ready for php7? Nagios is the only thing using apache and PHP on the server.

Nagios is monitoring and emailing alerts just fine. I just can't get to the web interface.

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

Re: PHP broke after Core3 to Core4 and php5 to php7 upgrade

Post by scottwilkerson »

Can you share any errors you are experiencing in your apache error_log when trying to access the page along with the current nagios.conf apache config file.

My guess would be that this had little to do with the nagios upgrade and most likely something wrong with the php upgrade.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
darthnul
Posts: 3
Joined: Wed Jan 16, 2019 1:57 pm

Re: PHP broke after Core3 to Core4 and php5 to php7 upgrade

Post by darthnul »

Thanks for the reply!

I'm pretty sure it's an apache/php7 issue but I've not had much luck finding what needs to change with all the apps to get it working again.

Apache won't start until I comment out these lines from the nagios directory config bits of httpd.conf:
php_flag engine on
php_admin_value open_basedir /usr/local/www/nagios/:/var/spool/nagios/

If I comment that out I can point my browser to http://ns2/nagios/index.php (or main.php) but the browser just asks me which application I want to use to open the file and no error is reported in /var/log/httpd-error.log.

I've found docs for optimizing PHP configs for high performance implementations but not so much for basic PHP7/Apache configs to get Nagios to work.
darthnul
Posts: 3
Joined: Wed Jan 16, 2019 1:57 pm

Re: PHP broke after Core3 to Core4 and php5 to php7 upgrade

Post by darthnul »

It's working now:
Looks like mod_php72 didn't get installed even though it was a known dependency. Once that was installed apache started without commenting the two php lines in httpd.conf.

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

Re: PHP broke after Core3 to Core4 and php5 to php7 upgrade

Post by scottwilkerson »

darthnul wrote:It's working now:
Looks like mod_php72 didn't get installed even though it was a known dependency. Once that was installed apache started without commenting the two php lines in httpd.conf.

Thanks again for responding anyway!
Great! Glad you got it working!

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