Division by zero

Created on 11 December 2023, 11 months ago
Updated 12 July 2024, 4 months ago

Problem/Motivation

We get this error on one of our servers:

[Mon Dec 11 18:55:15.244348 2023] [proxy_fcgi:error] [pid 2539467:tid 140566251677376] [client 127.0.0.1:56878] AH01071: Got error 'PHP message: Uncaught PHP Exception DivisionByZeroError: "Division by zero" at /home/insite/test/sites/insite-drupal-main/web/modules/contrib/cache_utility/src/Form/SettingsForm.php line 763'

Steps to reproduce

This seems to happen when opcache.file_cache_only is enabled.
opcache_get_status() then returns this:

array(3) {
  ["opcache_enabled"]=>
  bool(false)
  ["file_cache"]=>
  string(29) "/home/insite/php-opcache-cli/"
  ["file_cache_only"]=>
  bool(true)
}

Proposed resolution

SettingsForm::getOPCacheDisplayInfo() should check if $status['opcache_statistics'] exists before trying to use it.

🐛 Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024