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

Moodle 3.2 errors out ungracefully in php54

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.2
    • 3.2
    • Installation

      Expected:

      • A nice moodle error about being on too low a verison

      Actual:

      Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /Users/danp/moodles/im/moodle/mod/forum/deprecatedlib.php on line 191
      

      Fix:

      diff --git a/lib/setup.php b/lib/setup.php
      index bc0b759042..c55c0f3d82 100644
      --- a/lib/setup.php
      +++ b/lib/setup.php
      @@ -338,8 +338,6 @@ if (file_exists("$CFG->dataroot/climaintenance.html")) {
           }
       }
       
      -if (CLI_SCRIPT) {
      -    // sometimes people use different PHP binary for web and CLI, make 100% sure they have the supported PHP version
           if (version_compare(phpversion(), '5.6.5') < 0) {
               $phpversion = phpversion();
               // do NOT localise - lang strings would not work here and we CAN NOT move it to later place
      @@ -347,7 +345,6 @@ if (CLI_SCRIPT) {
               echo "Some servers may have multiple PHP versions installed, are you using the correct executable?\n";
               exit(1);
           }
      -}
       
       // Detect ajax scripts - they are similar to CLI because we can not redirect, output html, etc.
       if (!defined('AJAX_SCRIPT')) {
      

      TODO: workout why we only do that in CLI_SCRIPT..

            poltawski Dan Poltawski
            poltawski Dan Poltawski
            Frédéric Massart Frédéric Massart
            David Monllaó David Monllaó
            Rajesh Taneja Rajesh Taneja
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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