PhP Upgrade

PhP Upgrade

by Frances Clynes -
Number of replies: 4

We are currently using Moodle version 2.8.1+ and want to upgrade. In order to do this I had to get our version of PhP upgraded to 7.1 by our webhosts. Now, we cannot add new users. 

The error message is: "Exception - Using $this when not in object context"

When clicked it shows a page with the message: 'error/moodle/generalexceptionmessage

On our Environment page there is a status message 'Check' in red for the database:

databasemysql (5.5.5-10.1.40-MariaDB)version 5.5.31 is required and you are running 5.5.5.10.1.40Ch

I would be grateful for any advice

thanks

Frances


Average of ratings: -
In reply to Frances Clynes

Php Upgrade

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm assuming what you mean is that you haven't upgraded Moodle yet; just PHP.

Unfortunately, Moodle 2.8 will not work with PHP 7 (see https://docs.moodle.org/dev/Moodle_2.8_release_notes#Server_requirements). You're going to have to upgrade Moodle.

To make matters worse, you need to upgrade to Moodle 3.1 before you can go any further. This is also, incompatible with PHP 7.1 (but is ok with 7.0). What you should have done is...

1. Upgrade Moodle to 3.1
2. Upgrade PHP to 7.1
3. Upgrade Moodle to 3.6

Possibly the safest thing is to temporarily revert the PHP version.

Regarding the database, I think you have the database type set to 'mysql' rather than 'mariadb' in your config.php. As their version number regimes are different, that setting is important.

As a general point, always make sure you read the relevant release notes carefully. There are all sorts of version incompatibilities just waiting to trip you up. If in doubt, just ask.
In reply to Howard Miller

Re: Php Upgrade

by Frances Clynes -

Hi Howard

Thank you very much for this. You are correct. I have temporarily reverted to PhP 5.6. 

I am going to schedule an upgrade to 3.1 for next Monday and then do as you say, and get PHP 7.1 installed. And if I get stuck, I shall absolutely take your advice and ask!

In the config file the database is:

$CFG->dbtype    = 'mysqli';
Should I change 'mysqli' to 'mariadb'?
Thanks again Howard,
Frances




In reply to Howard Miller

Re: Php Upgrade

by Frances Clynes -

Just one other question

The docs say we can only upgrade to 3.7 from 3.2 and upwards but you say we can do it from 3.1?