Moodle install.php Not Working

Moodle install.php Not Working

by Mehmed Emre Akdin -
Number of replies: 3

Hello, I installed moodle on ubuntu serverI go to the page : http://"my ip adress"/moodle/install.php

But I get an error like this:

Moodle 3.7 or later requires at least PHP 7.1.0 (currently using version 7.0.33-30+ubuntu16.04.1+deb.sury.org+1). Some servers may have multiple PHP versions installed, are you using the correct executable?

I updated php:

php -v

PHP 7.4.9 (cli) (built: Aug 7 2020 14:29:10) ( NTS )
Copyright © The PHP Group
Zend Engine v3.4.0, Copyright © Zend Technologies
with Zend OPcache v7.4.9, Copyright ©, by Zend Technologies

Is there anything else I can do thank you.



Average of ratings: -
In reply to Mehmed Emre Akdin

Re: Moodle install.php Not Working

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Somehow your web server is using a different version of PHP to your command line (CLI).

Maybe both versions are installed in which case you'll need to work out how to configure the web server program (e.g. Apache, Nginx) to use the later version.

Or maybe the PHP 7.4 upgrade has replaced PHP 7.0 but the web server process (Apache, Nginx, or PHP-FPM) is still running with the older version in memory and just needs restarting.

As Ken says, Moodle 3.7 doesn't support PHP 7.4, you'll need Moodle 3.9 for this.

In reply to Leon Stringer

Re: Moodle install.php Not Working

by Thorsten Bartel -
Picture of Core developers
Adding to this:
Apache on older Ubuntu versions (as 16.04 certainly is) tends to use a Multiprocessing Module named "Prefork" which comes with it's own PHP implementation embedded into the Apache process. To update this, execute the following:
"sudo apt-get install libapache2-mod-php7.2" (or whichever version you prefer)

You would also be well advised to switch from Prefork to Event (with php-fpm) if you're comfortable doing that.
Downgrading from PHP7.4 should also be a priority, since the cronjob will use your CLI-version of PHP.

After updating your PHP version, ensure that the required PHP extensions for Moodle are still installed.