Upgrade to 4.3

Upgrade to 4.3

by Kody Spencer -
Number of replies: 23


I get the above message after upgrading Moodle to 4.3. Running PHP Version 8.2.1, Ubuntu 22.04 LTS.

Average of ratings: -
In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Is there a 'antihammer' directory in newcode/auth/ folder?

Copied from old code folder into new code folder at same location as old location.

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 4.3

by Kody Spencer -
There is not. I have downloaded the plugin and moved it to the newly created folder in /var/www/html/moodle/auth/auth_antihammer, but after reloading apache that stuff still shows up on the webpage.
In reply to Kody Spencer

Re: Upgrade to 4.3

by Kody Spencer -
My question is that the only thing that I moved over during the migration from the old moodle version to the new was the config.php file. In that file nowhere it states anything about antihammer.
In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Normally, config.php file doesn't contain any references to auth plugins.   But I don't run antihammer so check config.php file to see if that looks like it has anything special in it.

The error text does say 'Authentication plugin antihammer not found.'

If you installed the plugin manually, what are ownerships/permissions on code/auth/antihammer directory as well as contents?

Directory and all folders/files contained therein must be readable by the globe ... that last set of rwx should have only r--.

Does your web service error log give any hints/clues?

'SoS', Ken
 
In reply to Kody Spencer

Re: Upgrade to 4.3

by Kody Spencer -
So, after more messing around with it somehow I was able to get all that stuff to go away but now when I attempt to login it sends me to this page below.

Exception - Call to undefined function mb_list_encodings()

More information about this error
In reply to Kody Spencer

Re: Upgrade to 4.3

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

Exception - Call to undefined function mb_list_encodings()

This suggests your PHP environment is missing the php-mbstring extension. The documentation on this a little out of date but may help.

In reply to Leon Stringer

Re: Upgrade to 4.3

by Kody Spencer -
I have it installed please see the output below.


In reply to Kody Spencer

Re: Upgrade to 4.3

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

PHP isn't finding the function mb_list_encodings().

You might need to restart the service php-fpm to apply the change instead of apache2.

If it's still not working use a PHP info file (a file containing <?php phpinfo();) to report your PHP configuration.

Search for "mbstring" and check that it's listed and enabled:

mbstring, Multibyte Support: enabled

And search for "disable_functions" to see if the function has been disabled (I can't imagine why it would be):

disable_functions: no value

Remove the PHP info file when it's no longer needed, it could provide information about your server useful to an attacker.

In reply to Leon Stringer

Re: Upgrade to 4.3

by Kody Spencer -
Ok, so after going through and installing all the requirements for php8.2 and php-fpm. I am down to this screen below and I am unsure how to proceed. I have ran ./configure according to https://docs.moodle.org/2x/pl/Compiling_PHP_from_source so that I have everything ready to go. However, when trying to log in I get this.


In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Didn't think anyone compiled any more as native package managers are best ... even installing php extensions and other libraries needed in support of the AMP stack.

The page you referred to shows how to compile for 2.x of Moodle and php 5.

Compiling means you control the libraries ... package manager sorts that for you!
(I speak from experience because many years ago I used to compile the entire AMP stack and found it to be a pain in the arse if I couldn't find a php extension needed or some other supports.)

Hmmmm ....
https://moodledev.io/general/releases/4.3
I see on above link that php extension sodium is now required.

So you might share from your history commands you used to compile although I'd strongly advise using package manager to install anything you need.   Again, package manager sorts out libraries needed automagically.

The other minus for compiling ... since your package manager did not install whatever, you won't be getting notifications or updates in an automatic fashion.   Easy to fall behind in patching ... which means your moodle server could more easily fall victum to those that would do harm!

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 4.3

by Kody Spencer -
Where do I get a package manager? How do I install it?
In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
You've been using the Ubuntu 22.04 LTS package manager already:
apt-get ...

https://tecadmin.net/how-to-install-php-on-ubuntu-22-04/

You just need an extension to the native package manager.

Clip from above link:

We will use the Ondrej PPA for installing PHP on Ubuntu 22.04 LTS system. Which contains PHP 8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0 & PHP 5.6 packages. You can install any of the versions required for your application. The new application developers are suggested to use the latest PHP version ie PHP 8.2.

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 4.3

by Kody Spencer -
I was able to complete that earlier today. That's what I used to get the additional extensions of PHP like mbstring. Below is the version I am running.


In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Ok, good!   Now is the antihammer notice cleared up?
only goes up to 4.0 of moodle and you are now running the latest/greatest!

'SoS'. Ken

In reply to Ken Task

Re: Upgrade to 4.3

by Kody Spencer -
Yes, I just get the message below when trying to log in.


In reply to Kody Spencer

Re: Upgrade to 4.3

by Kody Spencer -
I have now fixed the error above but now I when I attempt to upgrade the Moodle DB this error below prevents me from upgrading. It sends me to this link https://docs.moodle.org/401/en/Environment_-_max_input_vars and I have ensured that max_input_vars= 5000 in the /etc/php/9.2/apache2/php.ini file and I have rebooted my Ubuntu server to see if it has any effect and it did not.


In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Devils are in the details!

There is no php version 9.2! sad

In current moodle server, go to admin menu -> Server -> php info.

Look for the ini file your PHP is using.

Also, in prep for upgrading one should do the environment check of current version to see what might be missing.  RED's must fix.  YELLOW's probably should fix.   Want all GREEN's.  If you do that ahead of the attempt  to upgrade, things will go a lot smoother! smile


One should also check addons - addtional plugins installed in current to make sure there is a compat version with destination version of moodle.

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 4.3

by Kody Spencer -

I was able to sort out the PHP part. I get past the prerequisite part and go onto the plugin checklist and I have a ton of red like this below. Does the link you provided above give me places to install these?



In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
The 'missing from disk' means you did not copy those addons from the old code directory into appropriate locations in new code directory.

As I mentioned before ... additional plugins should be checked for compatibility prior to attempt to upgrade:


From link above ... a clip:

Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (check that custom plugins are the correct version for your new Moodle first):

cp moodle.backup/config.php moodle
cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme
cp -pr moodle.backup/mod/mymod moodle/mod/mymod
'SoS', Ken

In reply to Kody Spencer

Re: Upgrade to 4.3

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
The error states it must exceed 5000 so setting it to 5000 will not fix the error - set it to 10000 (I actually set mine to 25000)
In reply to Kody Spencer

Re: Upgrade to 4.3

by Ken Task -
Picture of Particularly helpful Moodlers
Gee ... what's that command?   I'd like to use it!
messaroundsomemore [ENTER]? smile

Since you've found another issue, might want to run from code/admin/cli/
php checks.php
Might find something else! :|

'SoS', Ken