Skip to content

Commit e6739fd

Browse files
committed
Fix SCSS compilation failure on PHP 7.4
1 parent fdbe5ee commit e6739fd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

front/css.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@
4747
include_once GLPI_ROOT . "/inc/db.function.php";
4848
include_once GLPI_ROOT . '/inc/config.php';
4949

50-
if (Toolbox::getMemoryLimit() < (128 * 1024 * 1024)) {
51-
// Main CSS compilation requires about 90MB of memory.
52-
// Increase it a bit to ensure it will not reach memory limit.
53-
ini_set('memory_limit', '128M');
50+
// Main CSS compilation requires about 140MB of memory on PHP 7.4 (110MB on PHP 8.2).
51+
// Ensure to have enough memory to not reach memory limit.
52+
$max_memory = 192;
53+
if (Toolbox::getMemoryLimit() < ($max_memory * 1024 * 1024)) {
54+
ini_set('memory_limit', sprintf('%dM', $max_memory));
5455
}
5556

5657
// Ensure warnings will not break CSS output.

0 commit comments

Comments
 (0)