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

cron.php executed on the CLI makes output to STDERR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3
    • Fix Version/s: 1.9.4
    • Component/s: Administration
    • Labels:
      None
    • Environment:
      Unix + PHP 5.2.6
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I am executing cron.php the recommended way - via PHP's CLI instead of accessing it with a browser, having browser access completely disallowed (Site Administration -> Security -> Site policies -> Cron execution via command line only: Yes). My crontab entry is:

      */30 * * * * php -d safe_mode="off" -d open_basedir="" /path_to/moodle/admin/cron.php > /dev/null

      However, this writes a warning to STDOUT, which will then get emailed every time:
      PHP Notice: Undefined index: REMOTE_ADDR in /path_to/moodle/lib/moodlelib.php on line 7513

      The notice of course does not harm, it is annoying however to receive all these emails. Thus, the code should be cleaned ensuring not producing any notice/warning.

        Attachments

        1. [MDL-16954].patch
          0.7 kB
          Robert Allerstorfer

          Activity

            People

            Assignee:
            dongsheng Dongsheng Cai
            Reporter:
            roal Robert Allerstorfer
            Tester:
            Petr Skoda Petr Skoda
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              28/Jan/09