PHP error while executing ./validate.php

**I am getting php error while executing ./validate.php **
PHP memory set on PHP.INI is 1024MB
OS : CENTOS
RAM : 4 GB

./validate.php output ::

librenms]$ ./validate.php
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /opt/librenms/vendor/composer/autoload_static.php on line 2426
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /opt/librenms/LibreNMS/Util/Version.php on line 1

If you are in Ubuntu, have you also edited de cli/php.ini?

1 Like

i am using centos . edited php.ini in etc/php.ini
128MB was there and i changed it to 1024MB.

Still showing the same error. Previously i was using old version of librenms. updated and asked to update php 7.2.5 , after that issues started.

using centos

librenms]$ php -i | grep memory_limit
memory_limit => 1024MB => 1024MB

Thats… odd.

Did you try to increse it a bit more? But…unless you have like 6k devices only in that host 1024 is waaaaaaaaaaay more than enough.

What you get with php -v?

[xxxxxxxxxxx@localhost ~]$ php -v
PHP 7.3.18 (cli) (built: May 12 2020 08:04:33) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.18, Copyright © 1998-2018 Zend Technologies

Hi,
Thanks for the repies…Actually server ram is 4 GB , will that be an issue ??

Depends on how many device/sensors you are monitoring.

Please, run ./lnms config:get php_memory_limit

No result while executing

[xxxxxxx@localhost librenms]$ ./lnms config:get php_memory_limit
[xxxxxxx@localhost librenms]$ ./lnms config:get php_memory_limit
[xxxxxxx@localhost librenms]$

[xxxxxxx@localhost librenms]$ ./validate.php
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /opt/librenms/vendor/composer/autoload_static.php on line 2426
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /opt/librenms/LibreNMS/Util/Version.php on line 1

Ok, lets do a try:

./lnms config:set php_memory_limit 1024

And try validate again

Still the same error

Im running out of ideas…

Is the server’s RAM totally used?

Yup. Previously it was working fine. Recently updated Librenms version and for that upgraded PHP 7 to PHP 7.3 .
After that issue started

maybe something is wrong with that update?

List php installed packages to make sure there are no old version ones installed

Tried all… As all options are out… I Reinstalled Librenms and now working fine. Lost all previous logs/ readings. Thanks for the support.