"version 7.0.0 is required and you are running 7.4.8"

"version 7.0.0 is required and you are running 7.4.8"

by Daniel Almeida -
Number of replies: 4

So, i have to migrate a moodle from a server to another.

Its moodle 3.4 and i copied everything from the old server.


IF i run moodle 3.5 with moodledata from the old server + PHP 7.4.8 i get the title error.

IF i downgrade my php to 7.0.33, 7.1 or 7.2... i get this:

Error Database


Literally nothing changed, except PHP Versions.

Average of ratings: -
In reply to Daniel Almeida

Re: "version 7.0.0 is required and you are running 7.4.8"

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

Yes, Moodle has some maximum PHP versions as well as minimum. This table shows some of them, Moodle 3.4 isn't listed but 3.5 is shown as working with up to PHP 7.2.

If you're getting "Database connection failed" after changing PHP versions the new PHP version may be missing the extension containing the database driver, e.g. php-mysqlnd for MySQL/MariaDB, php-pgsql for PostgreSQL, or php-sqlsrv for SQL Server.

"Literally nothing changed, except PHP Versions" – well presumably the Moodle server's IP address has changed too, it's possible there's a restriction with the database user ($CFG->dbname in config.php) or a firewall rule that's blocking the connection from the Moodle server to the database server.

If you enable debugging by adding the following lines to config.php hopefully you'll get some more details about the problem:

@error_reporting(E_ALL | E_STRICT);
@ini_set('display_errors', '1');
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1;
In reply to Daniel Almeida

Re: "version 7.0.0 is required and you are running 7.4.8"

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Well you say that nothing changed but you are on a totally different server so it is totally different.
1. Why are you only upgrading to 3.5? Why not go to a later version that is compatible with 7.2 or later?
2. Have you installed all the necessary php extensions? (php-mysql, e.g)
3. Did you copy over your config file? Has the database user been added to the new site?
In reply to Daniel Almeida

Re: "version 7.0.0 is required and you are running 7.4.8"

by Daniel Almeida -
Solved: alter user 'username'@'localhost' identified with mysql_native_password by 'password';
Average of ratings: Useful (1)