PHP Fatal error: Allowed memory size after 5.4 to 5.6 upgr
Posted: Mon Aug 21, 2017 8:56 pm
Hi,
I am testing PHP upgrade from 5.4 to 5.6 for Nagios XI.
I have Centos 7 and installed XI from xi-5.4.8.tar.gz and got a working XI instance. I have not done any additional config steps - so this is fresh, "out of the box" installation.
Then I have unistalled php 5.4 and installed 5.6
Finally fixed SouthGuardian and set PHP memory limit to 512M
After restarting httpd service I tried to open Nagios XI page and got HTTP 500 and this error httpd errpr_log:
[:error] [pid 10010] [client 192.168.56.1:63467] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294902125 bytes) in /usr/local/nagiosxi/html/includes/dbl.inc.php on line 2, referer: http://192.168.56.110/nagiosxi/install.php
So why suddenly it is trying to allocate 4GB of memory and how do I fix it ?
Thanks
Genna
I am testing PHP upgrade from 5.4 to 5.6 for Nagios XI.
I have Centos 7 and installed XI from xi-5.4.8.tar.gz and got a working XI instance. I have not done any additional config steps - so this is fresh, "out of the box" installation.
Then I have unistalled php 5.4 and installed 5.6
Code: Select all
yum install centos-release-scl
yum remove php-common-5.4.16-42.el7.x86_64 php-mcrypt-5.4.16-4.el7.x86_64 php-cli-5.4.16-42.el7.x86_64 php-pgsql-5.4.16-42.el7.x86_64 php-process-5.4.16-42.el7.x86_64 php-gd-5.4.16-42.el7.x86_64 php-xml-5.4.16-42.el7.x86_64 php-ldap-5.4.16-42.el7.x86_64 php-mysql-5.4.16-42.el7.x86_64 php-mssql-5.4.16-4.el7.x86_64 php-snmp-5.4.16-42.el7.x86_64 php-pdo-5.4.16-42.el7.x86_64 php-pecl-ssh2-0.12-1.el7.x86_64 php-5.4.16-42.el7.x86_64 php-mbstring-5.4.16-42.el7.x86_64
yum install rh-php56-php-common rh-php56-php-mcrypt rh-php56-php-cli rh-php56-php-pgsql rh-php56-php-process rh-php56-php-gd rh-php56-php-xml rh-php56-php-ldap rh-php56-php-mysql rh-php56-php-snmp rh-php56-php-pdo rh-php56-php rh-php56-php-mbstring
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php54.off
mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off
cp /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php56-php.conf /etc/httpd/conf.d/
cp /opt/rh/httpd24/root/etc/httpd/conf.modules.d/10-rh-php56-php.conf /etc/httpd/conf.modules.d/
cp /opt/rh/httpd24/root/etc/httpd/modules/librh-php56-php5.so /etc/httpd/modules/
After restarting httpd service I tried to open Nagios XI page and got HTTP 500 and this error httpd errpr_log:
[:error] [pid 10010] [client 192.168.56.1:63467] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294902125 bytes) in /usr/local/nagiosxi/html/includes/dbl.inc.php on line 2, referer: http://192.168.56.110/nagiosxi/install.php
So why suddenly it is trying to allocate 4GB of memory and how do I fix it ?
Thanks
Genna