Skip to main content

Symptom

 

You get the message “PHP Fatal error:  Allowed memory size of X bytes exhausted (tried to allocate X bytes) in /path/file.php on line X”.

This error message could appear in centreon-error.log after an update or an upgrade.

 

These are some issues caused by this error:

 

Solution

 

  1. Run the following command depending on the PHP version:
  • For php8:
    /etc/php.ini
  • Increase this value (256M or 512M for example):
    memory_limit = 128M
  1. Then run this command:
    systemctl restart php-fpm

These are the paths and commands to use for php72 and 73:

/etc/opt/rh/rh-php72/php.ini

/etc/opt/rh/rh-php73/php.ini

systemctl restart rh-php72-php-fpm

systemctl restart rh-php73-php-fpm

 

See also

https://www.php.net/manual/en/ini.core.php#ini.memory-limit

Be the first to reply!

Reply