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

cron.php executed on the CLI makes output to STDERR

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.3
    • 1.9.4
    • Administration
    • None
    • Unix + PHP 5.2.6
    • Any
    • MOODLE_19_STABLE
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              28/Jan/09