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

Installation error when php xml is not installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.5, 3.1, 3.2
    • Fix Version/s: 3.0.6, 3.1.2
    • Component/s: Installation
    • Labels:
    • Testing Instructions:
      Hide

      Note: To test this issue, you need to have the ability to disable libxml. On most distros, the inbuilt php will not allow you to do this as php ships with libxml baked in. Someone in HQ will have a machine that can do this if you don't!.

      Test procedure:

      1. You'll need to start with a new Moodle site, not yet installed. I recommend using MDK, but you can just pull a copy from git too if you like. If you're using MDK, you can run:

        mdk create -t -v master -n mymoodle
        

        to create a new site called mymoodle, based on integration.

      2. Now, disable your libxml. This should involve something like:

        sudo apt-get remove php5.6-xml
        sudo service apache2 restart
        

        depending on your distro.

      3. Begin the Moodle installation process.
      4. Complete the first few steps, select mysql for the db and save the config.php.
      5. Continue until you get to the page: http://localhost/mymoodle/admin/index.php?cache=0&lang=en&agreelicense=1
      6. Confirm that
        • The page loads normally (no browser errors or 500 server error)
        • You see a message saying 'You need to add XML support to your PHP installation'
      7. Reinstall and enable libxml, leaving the Moodle install open:

        sudo apt-get install php5.6-xml
        sudo service apache2 restart
        

      8. Reload the page and confirm that you see a list of server checks.

      Windows testing:

      1. Verify Moodle installs without problem under Windows, the XML extension is bundled there and should be always available.
      Show
      Note: To test this issue, you need to have the ability to disable libxml. On most distros, the inbuilt php will not allow you to do this as php ships with libxml baked in. Someone in HQ will have a machine that can do this if you don't!. Test procedure: You'll need to start with a new Moodle site, not yet installed. I recommend using MDK, but you can just pull a copy from git too if you like. If you're using MDK, you can run: mdk create -t -v master -n mymoodle to create a new site called mymoodle, based on integration. Now, disable your libxml. This should involve something like: sudo apt-get remove php5.6-xml sudo service apache2 restart depending on your distro. Begin the Moodle installation process. Complete the first few steps, select mysql for the db and save the config.php. Continue until you get to the page: http://localhost/mymoodle/admin/index.php?cache=0&lang=en&agreelicense=1 Confirm that The page loads normally (no browser errors or 500 server error) You see a message saying ' You need to add XML support to your PHP installation ' Reinstall and enable libxml, leaving the Moodle install open: sudo apt-get install php5.6-xml sudo service apache2 restart Reload the page and confirm that you see a list of server checks. Windows testing: Verify Moodle installs without problem under Windows, the XML extension is bundled there and should be always available.
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55083_master

      Description

      When installing moodle on a system with no PHP XML installed, the following error appears:

      Call to undefined function xml_parser_create()

      The solution is to install PHP XML and restart apache.
      For example, on ubuntu PHP 7.0:

      1. apt-get install php7.0-xml
      2. service apache2 restart

      I think that the installation process should present the user with a more user-friendly description of the problem, instead of a generic PHP error. For example, something similar to what happens when zip, gd or other required PHP extensions are missing.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tunele Antonello Moro
              Reporter:
              tunele Antonello Moro
              Peer reviewer:
              Jake Dallimore Jake Dallimore
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Mark Nelson Mark Nelson
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Sep/16