PHP error on fresh install

PHP error on fresh install

by Mark Ferron -
Number of replies: 4

Hello!

I followed the official guide to install Moodle 3.9 on my Ubuntu 20.04 LTS server running apache. I was able to get past the second page where it asks for the username and password of the database you want to connect to but now my page is stuck on:

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

I'm assuming that this is because I deviated from the original guide slightly. Originally the guide installs php7.2 but I must of ran apt upgrade at some time because the output of a2query -m | grep php is: 

php7.4 (enabled by maintainer script)

Should i force a downgrade to 7.2 or do you guys know a way I can make it work with 7.4?

Average of ratings: -
In reply to Mark Ferron

Re: PHP error on fresh install

by James Steerpike -

sudo apt install graphviz aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-intl php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-ldap php7.4-zip php7.4-soap php7.4-mbstring

Average of ratings: Useful (1)
In reply to James Steerpike

Re: PHP error on fresh install

by Mark Ferron -
Ahhh. It worked. Thank you. So I must of been missing some more php7.4 things?
In reply to Mark Ferron

Re: PHP error on fresh install

by Ken Task -
Picture of Particularly helpful Moodlers

According to chart, php 7.4 is highest for 3.9.

http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

what you might need to do is install missing php extensions.

https://docs.moodle.org/39/en/PHP#PHP_Extensions_and_libraries

That you can do with apt-get for the extension.

Once installed, afraid you have to restart apache for it to know they are there.   That will kill anything php wise.

But all may not be lost ... check to see if a config.php file exist in the code directory.   It is does install only lacks the installation of the DB and that one can do with a php script in code/admin/cli/ ... called install_database.php

Had something happen the other day installing a sandbox 3.9 ... and experience a hickup after entering admin account info ... it is that stage where config.php is created and the tables for the database for moodle are built.   Running the install_database.php fixed it. smile

Good luck!

'SoS', Ken