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:
- Impossible to display the parameters of a curve.
- The page remains empty/blank. Like here : https://thewatch.centreon.com/platform-7/unable-to-add-new-curve-blank-page-487?postid=1549#post1549.
- Connection via LDAP is impossible.
- The massive change action fails because too many elements are selected.
- “500 Internal Server error” occurs.
- Impossible to download/open an event report (when clicking on the XML and CSV icons).
- etc.
Solution
- 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
- 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