Moodle 4 Install

Moodle 4 Install

by Andreas Schubert -
Number of replies: 30

What a pain to install this programme.

After almost 2 days work I managed to install the system but I am getting different errors - I am not a beginner, but don't know how any further. I attach a screenshot.

This is a clear new install of Moodle 4 on the Server, although there is another Moodle-instance running on the server (on a separate database). PHP 8.

Has anybody encountered the same problems and yould help me?

I tried to edit the code in the named files (e.g. comment out) but without success.


Greetings!

Attachment Screenshot 2023-01-04 at 11-19-57 Fehler.png
Average of ratings: -
In reply to Andreas Schubert

Re: Moodle 4 Install

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Firstly, commenting out core code isn't going to help. It *should* work. Make sure you meet all the basic requirements - for example, that's definitely PHP 8.0 (not 8.1 etc)?

Has the install run from beginning (empty database) to the end (having asked for the admin password and site name) in one go? If it's failed and you've somehow got it going again you could easily have a corrupt/incomplete installation.

If it took you 2 days, I imagine you had other problems. It'll probably help to tell us a bit more about your install, what you did and what went wrong. What instructions did you follow? 

I know it's easy for me to say but I can install Moodle in under 30 minutes if I'm rushing. It shouldn't be so difficult. 
Average of ratings:Useful (1)
In reply to Andreas Schubert

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

The 'best way' to install/maintain/upgrade a moodle is via command line.

Acquire the code via git ... once branch and tracking set to version desired, one can use the php scripts in admin/cli/ of code to install.

See:

https://docs.moodle.org/401/en/Git_for_Administrators

Prior to getting the code via git and running the install script in code/admin/cli/:

blank database (contains no tables) created from cli with proper character set/collation

moodledata directory created manually with proper ownerships/permissions before running install script.

'SoS', Ken

In reply to Andreas Schubert

Re: Moodle 4 Install

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

This looks like the install script didn't get completed so there are settings missing in the database. See this reply.

In reply to Leon Stringer

Re: Moodle 4 Install

by Andreas Schubert -

Hi Guys,

thank you so much for your quick responses and help.

I'am on PHP 8.0 - sorry, I forgot to mention the complete version number.

Yes correct, the installation procedure was not completed - I din't come to the point where I was asked for an admin-acount or Login.

What I did was:

  • I started with a new and empty database (no tables; I checked the collation - I had an error with that before, but I could solve this, it should be correct now)
  • I copied all files to the server by FTP (as I did with older moodle versions before - as I mentioned, it is not the first installation I do) - I did this more than once, I mean I started over a few times and every time I got different errors.
  • I checked the rights management of the folders on the server and the location of the /moodledata-folder - no problems with that
  • I don't think I have a time out problem, the server responses quite quickly
  • I installed the database-connection, worked (after some problems)
  • After that Moodle starts to install the plugins.
I stuck after the installation of the plugins: there was a error I could solve, but after the plugins installed successfully I pressed "proceed" and on the next page this error page occurs I posted a screenshot of. Somehting ist wrong in the "/lib/classes/user.php" file. I don't know yet if this is one error in my screenshot or different errors.

I'm sorry I don't know how to use command line procedures. Maybe it would be better to go this way, but it should work with my workflow as well, shouldn't it?
Maybe it's a problem with the server - the system is on a shared server run by a mass provider and I have not many rights to change the server configuration.

Do you think the error depends on corrupt or missing files? Do I have any change to solve this "coding exception thrown"?


I really appreciate your help.
Thank you!



In reply to Andreas Schubert

Re: Moodle 4 Install

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What I would do....

Delete and recreate the database.
Copy config-dist.php to  config.php file. Open it in an editor and carefully add all the basic settings. Go down to the debugging section and uncomment the debugging lines. The file is very well documented so it should be clear. If you're not sure, ask.

Try installing Moodle again. It won't ask for the basic settings as they are already in config.php. If you get an error, stop and tell us what it is.
In reply to Howard Miller

Re: Moodle 4 Install

by Andreas Schubert -

Hi Howard,

thank you - yes, I think, that's a good idea. I started all over, once again. This time I used the config as you mentioned - I renamed the "config-dist" to "config" and added all the relevant data manually. I deleted all contents in the database prior to the installation.

Plugin-installation started properly.

It - almost worked. But I ended up with a new error message I havn't seen before. I add a screeshot... 😪


Cheers...

Attachment Screenshot 2023-01-04.png
In reply to Andreas Schubert

Re: Moodle 4 Install

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Other folks have been providing you with some good guidance. I am not sure what "tools" you have available, but I made some videos about how one can install Moodle on a VPS, shown in this post, that might be helpful to you.  One thing that I noticed in your posts is that you say you are uploading all of the Moodle application files to your server using FTP.  While that might work, Moodle contains a zillion files, so it is often better to uncompress the moodle.tgz download on your server, not on your local computer.
In reply to Rick Jerz

Re: Moodle 4 Install

by Andreas Schubert -

Hi Ken and Rick,

thank you for your replies.

The hoster's name ist Hosteurope, a large german provider with professional support - it is a shared server but not that cheap ;)
I know that there would be better solutions by using dedicated server - but as I mentioned I installed Moodle3 systems a few times before, so I am not an absolute beginner, and I never faced such trouble like this time with Moodle4 ...

Yes, I loaded up all files by FTP and checked for upload errors. The FTP client told me, that all files where uploaded successfully. Unfortunately I have no SSH access to the server.

And, Ken, this is not an upgrade attempt - I try to install Moodle from scratch on the server. All the plugins are coming with the Moodle 4.1+ bundle, I use no extra plugins yet.

I should add: in the installation process on the "Server checks" screen I found no issues, so the server meets the minimum requirements for Moodle... the trouble is starting on the next screen obviously, while installing the plugins.


Thank you guys, I'll check the mentioned posts and ressorces.
Andreas

In reply to Andreas Schubert

Re: Moodle 4 Install

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Are you absolutely sure that you're using a stable download of Moodle? Is there a particular reason for using the 'plus' version? This will be the weekly build and should be fine, but...
In reply to Andreas Schubert

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, 'not your first rodeo' (as we would say in Texas) ... you have experience!

'Devil' is always in the details!

Since it stops at creating the tables in your DB, here's what might be tripping you up:  From Moodle ...

PHP setting max_input_vars is recommended to be >= 5000 for PHP 7.x installations. It's a requirement for PHP 8.x installations. For further details, see Environment - max input vars.

Provider shows php info of systems per php versions
https://hosteurope-cpanel.de/php80/info.php
as an example:
Linux buildfarm06.corp.cloudlinux.com 4.18.0-425.3.1.el8.x86_64 #1 SMP Tue Nov 8 14:08:25 EST 2022 x86_64 x86_64 x86_64 GNU/Linux

See the 'el8' above?  Should mean CentOS Enterprise release 8.
Server API LiteSpeed V8.1 Cloudlinux 1.3
Don't use LiteSpeed but from what I gather tweaks are normally done via .htaccess files.

Guess you'd have to set via .htaccess:
php_value max_input_vars 5000

Prior to install!

The server checks prior to install does versions/extensions, but not sure about php settings/values like max_input_vars.   Would hope so but ....  I do mine via command line (checks are done there as well) and I have already max_input_vars in config due to other sites on same server.

Anyhoo ... my 2 cents!

@Rick ... is that covered in Videos?

'SoS', Ken


In reply to Ken Task

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up to own post ... just to keep it together ...

Before you attempt again,

1. check the DB for the site to see if any tables were created at all.   If they were you might have to drop database and setup new blank DB.

2. check the code directory for a config.php file.  Is one there?  Might also have to move that to config.php-old so Moodle can build a new one.

Too bad you don't have Terminal ... for in admin/cli/ of code there is a php script that installs the DB - taking the LiteSpeed server out of the loop!

One more reason, to me, to acquire command line access - for initial install is but tip of an iceburg for a long time to come (maintenance) ... there *will be* updates which are fixes to code as well as security updates!  Those could easily more reliably acquired via command line git - in a matter of minutes ... instead of all the steps one has to do the non-command line way.   But ... that's again, my 2 cents - ain't my 'first rodeo' either! smile

'SoS', Ken



In reply to Ken Task

Re: Moodle 4 Install

by Andreas Schubert -

Hi Ken,

YIPEEEHHH! "RODEO" - that's exactly what I feel I am in right now ...!! 😵‍

Thanks for the idea and your inquiry, Ken, but - I should have mentioned in advance - I already provided the "php_value max_input_vars 5000" in an htaccess-file on the server - that's a must-have, otherwise the installation isn't even starting at all.

And I used the original download-file from the official moddle-website. The 4.1+ version because it was recommended for production...


BUT I finally managed to get it running. I just wanted to post a screenshot of every page and every error occuring while installation - but this time it went all through without problems. What di I do? No clue. I deleted the database (again) and started with a new one. Then I uploaded all the files from the 4.1+ ZIP (again), and started over. And it worked. Maybe there was a corrupt file or something else, I don't know.

Thank you for your responses and keeping me motivated to try again... and again... I really don't understand how a person without any experience should manage to get this system going. (I had my troubles but am a webdesign for more than 20 years...)

Thank you for your support!
Cheers!
Andreas

BTW: I never worked with command line technology (awkward, I know) - do you have a link for me where I could get aquainted with it ... for dummies? 🫣



In reply to Andreas Schubert

Re: Moodle 4 Install

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
It's server software so it's unavoidable that you need at least a level of server administration skill. Or are happy to acquire that. In the great scheme of things, it's not particularly difficult to install. On a similar level to something like Wordpress.
In reply to Andreas Schubert

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

@Howard is 100% correct ... since you are working with a server, a minimum level of your server environment is necessary to be 'successful'!

Now that you are over that install 'hump' the 'journey' has just begun.   Now comes updates and maintenance.  Right now your Moodle is latest and greatest ... near 4.1+ (Build: 20221201).   As time passes and moodle releases fixes to code and security updates, the 'latest/greatest' will be 4.1.1, may a 4.1.1+, then a 4.1.2, then a 4.1.3 - maybe even an unplanned 4.1.x due to an 'exploit in the wild' (you are probably familiar with Windows so that's what is known as a 'Zero day' flaw/fix/patch.

You have exhibited characteristics that are absolutely needed for 'success' not only in install of a Moodle but I'll go as far to say 'in life' as well. ... and that's your 'failure quotient' and 'never quit' attitude!   And Rick's suggestion is a good one ... cept this time, use git.

If at all possible, on the same server you have for production because it's exactly the same environment ... but that would mean exercising some caution on things that are server wide as those would affect your production Moodle.

But what of leasing another instance where you host ... just less resources ... but enough to run a dev moodle.

Ahhhh ... the 'dummies' books ... yep nice to have something to read ... early on I read a book called 'The CooCoo's Egg!' - how a 1 cent error in accounting on a shared time UNIX system @Livermore on West coast of USA, led to the capture of a hacker from a country in Europe.  Author shared some commands in that book that tweaked my interest since I as, at the time, admin'ing a Free BSD all in one server for an Education Service Center in Victoria, Tx. with nothing more than a Master's Degree in 'Instructional Technology'!!

So finding info isn't difficult ... Google searches can find tons of info ... but one needs to learn how to apply what you read to your server environment.   Can't copy and paste everything your read online to your terminal and expect that to work! :|

I've read that the most important command to learn is 'man' ... the online manual to your operating system ... but many providers who offer shared and Terminal access to those shared setups, won't have 'man' installed.   Besides, that's more than you really want to know ... for now.

What you want is 'targeted' and specific ... *just enough* to help admin a  moodle server.

With that in mind ... check your PM for a link I'll share with you! smile

'SoS', Ken


In reply to Ken Task

Re: Moodle 4 Install

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Ken, no, setting max_input_vars to 5000 is not in the video, probably for two reasons:
  1. The requirement for max_input_vars happened after I made this video in April 2020, where I demonstrated installing version 3.8 of Moodle. 
  2. I do mention in the video that all PHP extensions should meet Moodle's requirements. I don't share minimum values that I change.  In the future, I should probably add something like "minimum PHP values" and "my recommended minimums," covering the following:
upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 384M
max_input_time = 600
max_execution_time = 1200
Add max_input_vars = 5000

When will videos have an "auto-update by reading my mind" feature?

@ Andreas.  I see your post stating that you had success.  Make sure to always erase everything from a failed Moodle installation attempt before beginning again.  Your success might have depended upon your "more than 20 years" experience, meaning a lot of luck.  You might never know what had changed.  If you want to experiment, try doing the installation again.  Doing so might help you understand how easy it is to install Moodle.  😀
Average of ratings:Useful (1)
In reply to Rick Jerz

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

@Rick

"When will videos have an "auto-update by reading my mind" feature?"

Think that's called 'AI' but am not sure I'd want to make 'Vulcan Mind Melds' with machines!  smile  Until that day, text/audio additions? (in BIG BOLD so as to draw attention to them?)

One installs only once ... there after, it's constant maintenance ... updates and upgrades - to not only Moodle code which is what an OP would think to do first (maybe incorrectly), but also PHP versions and extensions/settings, as well as DB versions/tweaks (always upwards on used Moodle sites).

As far as moodle code goes, git ... 'fewer moving parts' - less prone to human error ... closer to AI .... and so on.

@Andreas - congrats!   Something different must have happened! smile

Response to your posting follows ...

'SoS', Ken




In reply to Rick Jerz

Re: Moodle 4 Install

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Prime example of why I quit making "how-to" videos and switched to, Books, instead. After the switch, my students never got left in the "video dust" and therefore never had to rewind. Also, updates to the directions then became very simple and easy to do. To me the switch to a Moodle book resource was not that onerous because I had always tried to create a script for the videos. I just started doing that in a book with pictures, as needed, and totally skipped making the videos.
Average of ratings:Useful (1)
In reply to AL Rachels

Re: Moodle 4 Install

by Andreas Schubert -

Thank you everybody!

Seems I have started a deeper discussion on system administration... 😁

Obviously I'll have to dig deeper into the system - I don't know where it will lead to and what my client itends with the system in future.
Yes, a betasystem is a good idea. Maybe I'll some routine in moodle installation after some time 😬


Thank you for your support!

Best wishes from germany!
Andreas


In reply to AL Rachels

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

@Leon ...

I, too!  Decided a video just to show that X worked.  Not really the 'beef' of the how to ...

https://drive.google.com/file/d/1hBgF5-1hjtdDOZ6JId4NrbzA_W5eP7xQ/view?usp=share_link

Link above part of the contents of the CureClas moodle I've online.

Link above might prompt for you to request permissions to view .. I will grant!

'SoS', Ken


Average of ratings:Useful (2)
In reply to Ken Task

Re: Moodle 4 Install

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You convinced me years ago to switch to using git, but I never adopted your script version of doing things. That's because my production server is self hosted and started life with just a 128GB SSD. I was worried I would run out of space. Even more more worried now as that server needs a rebuild, so my production stuff is currently on a Raspberry Pi 4 with 8GB of RAM and a 64GB MSDC for storage. I am planning to adopt your script when I get the old server rebuilt, so thanks for the video showing what it does. NOTE: The video also points out the problem I referred to in my last post regarding getting out of date quickly and being too much of a pain to update. The video is for version M3.1+ and we are currently at M4.1+, which might confuse some folks, but in this case it still gets the point across.
In reply to AL Rachels

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

@Al ...

True ... should make another showing 4.x to keep up to date.

Space - yes, that is a concern but considering the original method of updating/upgrading actually doubles space usage and inode limits on shared hosting, where the git method doesn't.  You have old code directory, plus the downloaded archive of code which must be un-compresses before taking the next step.   One removes old code only after the upgrade has been tested and old code is no longer needed. 

Using git the code stays in place as do plugins and git works only with core code changes, deletions, new files.  No moving parts/pieces.

Plus, finishing the update/upgrade via command line takes web service out of the loop - just php talking to DB.   No un-anticipated time outs.

Plus, downtime is kept to a minimum.

Plus, makes it much easier to get those point releases thus keeping core code up to date and most secure.  That has always been a 'sore point' due to old method ... as the original poster in this thread said ... 'a pain ....'.

Plus, combine it with backup first as video shows we get 'two birds with one stone'.

One thing discovered ... cannot run cron job while in maintenance mode.  And running cron job just before the git update/upgrade cleans up/makes tables smaller in some cases, etc.

With newer versions of Moodle there is a checks.php script which could be run just prior to the git acquisition of core code to make sure php version/extensions and DB version/config is OK.

Still, however, there is no check of plugin compatibility for destination version but that too could be accomplished via a moosh script run prior to the upgrade.

I truly do not see any downside to git!

Thanks for the quick critique and suggestion as well as your verification that the git method does indeed work! smile

I'll send you a PM with a link you might want to check out after posting this!

'SoS', Ken


Average of ratings:Useful (1)
In reply to AL Rachels

Re: Moodle 4 Install

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi AL

You wrote:
> my production stuff is currently on a Raspberry Pi 4 with 8GB of RAM and a 64GB MSDC for storage.

I know, you are the person with racks of Raspberry Pis and other micros. But didn't know that your production Moodle server runs on a R Pi. ;)

> I am planning to adopt your script when I get the old server rebuilt,

Reasons? Any shortcomings of the R Pi solution?

I am asking because, I am playing with the idea of running an upcoming workshop (on system administration) on a dedicated R Pi. The gag is not only the corr. Moodle site will be on the Pi, but the participants will also do their assignments on the same Pi, in the Shell.

Oh, yes. It'll be a Pi 4 B, 4 GB with a quality SD card. Number of participants will be 50. Not that I'm worried about the performance. I know how well the MoodleBox performs.
In reply to Visvanath Ratnaweera

Re: Moodle 4 Install

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, as of a couple of weeks ago my production Moodle 4.1+ was moved to the Pi 4. I am usually the only user, but occasionally do have users I give access to, to try out new capabilities of my plugins I maintain.

I do plan on refurbishing the old server, simply because of it's noticeable speed advantage (3.7 GHz) and the new 1TB SSD's I have for it.

Except for a one time stop and clean out, it has been running non-stop for about 10 years and the CPU cooling fan and chassis fan, are getting a little noisy. The power supply in the server does not have a fan. Wish I had bought a couple extras of those, as the prices have gone up a bunch.

I am hoping the supply chain for Pi 4's gets back to normal soon. I would love to try a Pi 4 cluster, but I am not willing to pay the, price-gouging prices, that are being asked for, when you can find a dealer who has any. Price gouging is so bad right now, that in some cases you could buy 3 regular motherboards, for the price of one 8GB Pi 4. 🤑

I just did a quick check on Newegg.com, and nearly every Pi 4 listing is shown as being from China, which REALLY makes me wonder, just who made the thing? 🤔
Average of ratings:Useful (1)
In reply to AL Rachels

Re: Moodle 4 Install

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Got it. The current server is a Pi 4. The old server a "real" (x86-64) server. Of course you can't compare them in terms of performance, it's like comparing apples to potatoes. But the horse power of the real server, is it needed if you can occasionally few other test Moodle (plug-ins) in it?

Yes, Pi was manufactured in China right from the beginning. Well, how could they sell it for USD 25.- otherwise?
In reply to AL Rachels

Re: Moodle 4 Install

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
So, Al, are you saying that you create books you regularly maintain as things change?

I do love books, and I continue to use books in addition to videos. However, in education, new knowledge is always happening, and even books need updating, which more large publishers do every two to four years.  Consider Moodle's docs... are they always up-to-date?

Updating any media is always challenging. I also understand the video "script" issues (i.e., captions.). I appreciate your thoughts to this side topic.
In reply to Rick Jerz

Re: Moodle 4 Install

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Rick, perhaps AL meant the Book resource - Book in upper case in the Moodle tradition. I also use the Book resource in courses where there are very detailed instructions on multiple topics. For me in this discussion "Books" means formatted text, the classical handout. Could be even a PDF. I know, you can't embed videos on a PDF. So if the "book" is HTML, one could still have videos. (I'm not going to talk about pointless PowerPoint®.)

In fact, in a Moodle course I am developing for a workshop, I switched to the simple Page resource. The reason: It'll give a handout per topic (Section in Moodle jargon).
In reply to Rick Jerz

Re: Moodle 4 Install

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Rick,

Sorry, I may have given the wrong impression. I never used text books from publishers in my computer applications classes. Did not have space at the computer tables, to lay them out. In fact the two sets that were delivered the day I was hired, sat on the classroom bookshelf unused until termites came in through a crack in the foundation, and completely devoured them from the inside. I never knew until I went to move the stacks, for some reason, and discovered the damage.

However, before I retired I was using the Moodle Book resource extensively for the two computer applications courses I taught. I seem to remember having about 350 of them, mostly due to the fact that I usually had the students working at a self paced speed, for every project I had them attempt. Typically, I would spend one class period introducing a new subject, such as Libre Office Writer. I would then have them work four to nine days working at their own pace doing various writing projects using directions in the Moodle books. If they finished everything early, they were allowed to do extra fun and game projects. For instance kids usually love to draw, and using a vector graphics drawing program, such as LO Draw, did you know that you can start with one rectangle, one circle, and one line, and turn them into Snoopy laying on top of his doghouse?

The books made it very easy to update the directions, on the fly, as needed. If a student spotted a misspelled word or other error, it could be fixed in just a minute or two. For instance, when Libre Office came out with a new version with changes to LO Write, I could skim through the applicable Book chapters and pictures, and again, if needed, make changes on the fly. I could usually get those changes made from home before the particular projects were attempted by students.

Even though I no longer teach, I still use Books to keep step-by-step setup directions for all the different server installations I have.
In reply to AL Rachels

Re: Moodle 4 Install

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Thanks Al (and Visvanth). I now understand a bit better.

In my courses, I always give students a bonus point for any error they find. Yes, any error. This is my technique to "continuously improve" my courses.  Of course, once they spot an error, I have to fix it. 🥲
In reply to Andreas Schubert

Re: Moodle 4 Install

by Ken Task -
Picture of Particularly helpful Moodlers

"shared server run by a mass provider"

Mind sharing the name of this 'mass provider'? and what level of 'shared' (many offer different leases from cheapo to not so cheapo)?

Does your shared server have/use mod_security?

'SoS', Ken