Accept PHP memory_limit of -1 as meeting requirement
authormaynardsmith <tony.maynard-smith@ntlworld.com>
Thu, 7 Jan 2021 16:26:22 +0000 (16:26 +0000)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 16:26:22 +0000 (16:26 +0000)
A PHP memory_limit of '-1' is specified as 'unlimited'.

Before the change the checkmemory() function generates a Warning if the limit is set to -1.  This shows up as a Warning in the Drupal Status Report, but more seriously also prevents the Drupal database update process (mydomain.com/update.php) from running.

After the change the value '-1' is accepted as meeting the requirement.

Civi/Install/Requirements.php

index 813b2f6f19391bc9296f0c79276bccba02877f24..e35d242d49d45a71a22bf8428897d69449145bfb 100644 (file)
@@ -173,7 +173,7 @@ class Requirements {
     if ($mem < $min && $mem > 0) {
       $results['severity'] = $this::REQUIREMENT_ERROR;
     }
-    elseif ($mem < $recommended && $mem != 0) {
+    elseif ($mem < $recommended && $mem != 0 && $mem != -1) {
       $results['severity'] = $this::REQUIREMENT_WARNING;
     }
     elseif ($mem == 0) {