Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84446

pcntl_signal() causes error in shared hosting, should be conditionally checked

XMLWordPrintable

      In shared hosting environments like cPanel, the `pcntl_signal()` function is disabled by default, causing a fatal error when running cron via CLI.

      This issue affects the following files:

      • /lib/classes/shutdown_manager.php
      • /admin/tool/behat/cli/run.php

      The solution is to check if `pcntl_signal()` exists before calling it:

      if (function_exists('pcntl_signal'))

      {     pcntl_signal(SIGINT, ['core_shutdown_manager', 'signal_handler']);     pcntl_signal(SIGTERM, ['core_shutdown_manager', 'signal_handler']); }

            dobedobedoh Andrew Lyons
            ufkstr Ufuk SATIR
            Tim Hunt Tim Hunt
            David Woloszyn David Woloszyn
            Meirza Meirza
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 34 minutes
                34m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.