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

Moodle 3.2 errors out ungracefully in php54

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Installation
    • Labels:

      Description

      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..

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16