Moodle requires the xml PHP extension. Please install or enable the xml extension.

Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Radu Toma -
Number of replies: 8

hello!

I have a huge problem with my moodle server. please help me if you can:

I have an ubuntu server 16.04 LTS and a moodle server 3.5.1. 

after i upgraded my ubuntu server to 18.04 LTS i'm unable to use the administrative zone in my moodle server. I got as an sort of error: "Moodle requires the xml PHP extension. Please install or enable the xml extension."

If I enter and account is ok...I can use the moodle as a regular user/student. but can not administrate anything on the moodle-server side.

I don't know what to do...any advice welcome!

Thank you very much!

Radu

Average of ratings: -
In reply to Radu Toma

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Install the extension then  wink

From the command line...

sudo apt install php-xml
sudo service apache2 restart
In reply to Howard Miller

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Radu Toma -

Hello!

Thank you for your quick reply!

I did these steps right after upgrading the  ubuntu server when i first noticed the error message in moodle...

In reply to Radu Toma

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

So you're saying you did that and it didn't work?

The most likely reason, in that case, is that your server is configured to use some other version of PHP.

Let's try this command...

a2query -m | grep php

What's the output?

In reply to Howard Miller

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Radu Toma -

hello!

here is the output for      a2query -m | grep php


php7.0 (enabled by maintainer script)


In reply to Howard Miller

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Radu Toma -

i have an idea (maybe is a silly one but i'll try smile )

could be possible the php version in ubuntu 18.04 to be upgraded to 7.2 and the initial moodle installation on initial ubuntu server (16.04) to be based on php 7.0 and here is why i have this error?! 

In reply to Radu Toma

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you upgrade to 18.04 you get PHP 7.2. If you have an earlier version then that must have been installed intentionally.


Try this...

sudo apt install php70-xml
sudo service apache2 restart
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by Radu Toma -

bingo!

that was it!!!


thank you very much!!

In reply to Howard Miller

Re: Moodle requires the xml PHP extension. Please install or enable the xml extension.

by James Steerpike -

Timely.  Somewhere in my rather haphazard fresh install I have both php72 and 71 and has exactly the same problem. The install hung until the correct version was installed.