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

Fatal error during installation if PHP curl extension is not installed

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1) Start installing Moodle on the system without curl PHP extension.
      2) After accepting license agreement

      • Confirm you can see "Server checks" page (/admin/index.php?cache=0&lang=en&agreelicense=1). Page must not be blank or contain messages about PHP errors.
      • Confirm you see the table row with the following cells: "php_extension", "curl" "must be installed and enabled".
      • Confirm you see "cURL PHP extension is not installed" message in "Other checks" table.
      Show
      1) Start installing Moodle on the system without curl PHP extension. 2) After accepting license agreement Confirm you can see "Server checks" page (/admin/index.php?cache=0&lang=en&agreelicense=1). Page must not be blank or contain messages about PHP errors. Confirm you see the table row with the following cells: "php_extension", "curl" "must be installed and enabled". Confirm you see "cURL PHP extension is not installed" message in "Other checks" table.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57163-undefined-function-curl_version

      Description

      Steps to reproduce:
      1) Start installing Moodle on the system without curl PHP extension (in my case it was a Debian Linux box without php5-curl package installed).
      2) After accepting license agreement you get redirected to "Server checks" page (/admin/index.php?cache=0&lang=en&agreelicense=1).

      Expected behavior:
      The page should load properly and display the information about missing curl extension.

      Actual behavior:
      In production environment this page is blank (because of disabled error reporting in PHP). In development environment with E_ALL error reporting level this page displays the following error:

      PHP Fatal error: Call to undefined function curl_version() in /path/to/moodle/lib/upgradelib.php on line 2334

      The problem is caused by changes introduced recently in MDL-55777:
      https://github.com/moodle/moodle/commit/f2330472f0963985deb34ca72ee2b33a6d4358b7#diff-ec328f1a30e59aed57fc4f0555f82f44R875

      The proposed fix (updated):
      https://github.com/vvzh/moodle/commits/MDL-57163-undefined-function-curl_version

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vvzh Vladimir Zhirov
              Reporter:
              vvzh Vladimir Zhirov
              Peer reviewer:
              Matteo Scaramuccia
              Integrator:
              David Monllaó
              Tester:
              Ankit Agarwal
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Nov/16