Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh George Mazevski -
Jumlah balasan: 14

Hello everyone!

I am new to Moodle and am interested in installing a new instance to support internal training initiatives for our small firm. When researching Moodle, I discovered that there have been significant changes made to the 5.1 release and that migration from previous versions (4.x and earlier) have been challenging for many customers. As a result, since we are starting brand new, I thought I'd try to push ahead and complete a Moodle 5.1 installation so that I will not have to worry about completing the upgrade in the future.

Now, I will apologize in advance, as we utilize Microsoft technologies so we are trying to install a fresh instance of Moodle 5.1 using Windows Server 2025, Microsoft IIS, PHP 8.5, Visual C++ Redistributable (latest version), and MariaDB 11.8.5. Unfortunately, we are running into configuration issues related to the refactoring of Moodle code with the 5.1 release and the introduction of the /public directory and all of the IIS configuration guides that we have found online reference prior Moodle releases.

At this time, I have completed the following steps:

1) Installed a fresh Windows Server 2025 VM with all Windows updates installed

2) Installed Microsoft IIS and configured SSL Certificate 

3) Installed PHP 8.5 and validated that PHP is working properly

4) Installed MariaDB and confirmed that MariaDB is working properly

5) I downloaded the Moodle 5.1 .ZIP from the Moodle website and extracted it to the /wwwroot directory in IIS

Although I have made many attempts to get through the installation wizard (e.g. assign folder permissions, verify URLs, etc.), I cannot complete the wizard because of the existence of the /public directory. I tried commenting it out in the config.php but I was still unable to complete the installation.

It appears to me that I need to either modify the folder structure of the Moodle .ZIP extract (which introduces breaking changes) or modify IIS configuration settings in order to point to the correct directory. However, since I can't find any guidance on how to do this with Moodle 5.1, I'm stuck.

Although I have been able to successfully install 4.5.7, I'm trying to avoid what seems to be a painful future upgrade to 5.1. With that in mind, has anyone had success in completing a Moodle 5.1 installation using the Microsoft technologies identified above? Any guidance would be greatly appreciated. Thank you.

Rata-rata penilaian:Useful (1)
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Visvanath Ratnaweera -
Gambar dari Particularly helpful Moodlers Gambar dari Translators

The reason you mention, the big operation migrating to 5.1, is a strong point to go for 5.1 in the case of a new installation. Generally, the Gen-5.x is still young and giving all sorts of headaches - the introduction of public/ is the least of them. All our production Moodle instances are on 4.5 LTS, just started testing 5.1.

The fact is that the Windows Dept. of this forum is very small - the vast majority is on Linux/Unix (server). But you seem to know Windows well (I don't at all), and will be able to solve your problem yourself by "translating" the Installation quick guide to Windows.

Other than that, one conflict I see is with PHP. There is no mention of PHP 8.5 in https://moodledev.io/general/development/policies/php.

Rata-rata penilaian:Useful (1)
Sebagai balasan Visvanath Ratnaweera

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh George Mazevski -
Thank you for your response! It seems like you have a lot of experience and a long history of using Moodle. Based on your experience, would you recommend I consider installing the stable version 4.5.7 knowing that this version works well in our environment and then fighting through the 5.1 upgrade in the future? I'd be interested in hearing your perspective, especially if there are "many" issues with the 5.1 release.

By the way, I did see the installation quick guide as well as the detailed IIS guide. However, these documents seem to be outdated as they don't account for the code refactoring and the introduction of the /public directory. Unfortunately, I just don't know enough about the Moodle code to figure it out on my own. If I can't get help here, then I may try to hire a consultant to help me figure it out.
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh AL Rachels -
Gambar dari Core developers Gambar dari Particularly helpful Moodlers Gambar dari Plugin developers Gambar dari Testers

Hi George,

Believe it or not, just 15 minutes ago, I finished installing a brand new Moodle 5.1 site. In this case, I used the free AI, Copilot, for help. If you try using Copilot, just be sure to give good details. In other words, I initially typed in that I was just setting up a Moodle site, and luckily realized that the initial set of directions Copilot gave me had an error in them. Once I made sure that Copilot knew I was using Rocky 9.6, the web user was apache, and was using folder /etc/http for it's conf files, the directions I received worked like a charm.

Change the prompts you give any AI to fit your scenario/setup, and maybe you will get things to work, I hope.

Rata-rata penilaian:Useful (1)
Sebagai balasan AL Rachels

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh George Mazevski -
Al,

Thank you for the response. I did use ChatGPT combined with some other sources to help compile an installation guide for Windows Server with IIS. Through extensive trial and error and significant effort, I made it all the way through the end of the installation wizard... only to get a dreaded "Coding Error Detected. It must be fixed by a programmer. Invalid property requested or the property does not have a default value." 
 
Since I had absolutely no issues installing Moodle Version 4.5.7, I have decided that we are not ready to deal with the hassle and headaches associated with installing Moodle Version 5.1 with limited (if any) Windows support. If I had more time, I would spend a week troubleshooting this further as I believe I'm really close to getting it to work. Unfortunately, I'm trying to get a bunch of tasks finished before the Thanksgiving holiday next week so I don't have time to play with this.
 
Ultimately, I am impressed with what Moodle has to offer, as we had started experimenting with a .NET/C# based LMS, but it simply isn't worth the development effort when Moodle has so much functionality and such significant potential. It is unfortunate that our initial experience with Moodle is at a time when the platform is going through a significant transition (i.e. IMHO 5.1 is not ready for "prime time"), but given the history of the Moodle team, I'm sure that they will get the 5.x releases to where they need to be and they will eventually be as stable and reliable as the previous 4.x releases. Unfortunately, that time isn't now.
 
For anyone else trying to install Moodle Version 5.1 on Windows, I have attached my step-by-step installation notes. Maybe someone can resolve the issues that I was not able to.
Rata-rata penilaian:Useful (1)
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Visvanath Ratnaweera -
Gambar dari Particularly helpful Moodlers Gambar dari Translators
Hi

Absolutely new to Moodle? Installed 4.5 LTS and running? Having trouble with installing 5.1? A clear case for 4.5 LTS, if you ask me.

These versions are not marriages. There is a thing called Upgrading - without losing data BTW. So, you can start today with 4.5 LTS and have time till 6 October 2027 to upgrade. If you take that long, then even 5.2 has reached EOL, your target will most likely be 5.3 LTS. Why not? Ref. https://moodledev.io/general/releases.

You deceived me. I have to downgrade "you seem to know Windows well" to "ChatGPT seems to know Windows well". FYI, the Code of conduct in theses forums says, "If you use AI to help write your question or reply, then add a note to your post 'AI used to help write this post.'" I wouldn't have replied and saved this confusion and time. So the Windows Shops don't know the differences between man and machine - or don't care? (Just venting, expecting no answers, won't reply anyway.)
 
Initially I wanted to ask you what in https://docs.moodle.org/501/en/Installation_quick_guide is outdated. I checked it the other day and found nothing factually wrong. No wonder looking at the people who edited it in October. Still added more than my 2cents and changed the "playbook". I am (normally) keen on reader comments - from humans with normal (biological) intelligence and other (deeper) things. Not from robots! So AFAIC no feedback expected either.
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Ken Task -
Gambar dari Particularly helpful Moodlers

Ok, apologize for this response in advance ... am playing 'devils advocate' here ... and I promise not to drag it out - one time posting. senyum

Now I know you said 'we are a microsoft shop', but I don't believe that really 100% true ... bet your network has wireless base stations, switches and for sure a router. Venturing a guess that none of those are Windows. senyum

Maybe it's time to think ... 'best tool for the job' ... and as Mr. V has pointed out most of what you'll find in forums or docs is linux based.

".... I will not have to worry about completing the upgrade in the future."

Uhhh ... if you are successful in getting 5.1 to run on your chosen platform, it's tip of a 'deep iceberg'.   Moodle releases new code each week.
See: https://moodledev.io/general/releases

5.1 is really a 5.1+ build date 20251113

5.0.3+ Build: 20251113

4.5.7+ Build: 20251113 - this is a long term support version.

The next LTS isn't until 5.3 which hasn't been released yet.

By far the best way to install, update/upgrade a moodle code base is using git.
Even Microsoft uses git ... owns their own GitHub.
https://github.com/microsoft

You will find projects for moodle there
https://github.com/microsoft?q=moodle&type=all&language=&sort=

But not core ... for core code
https://docs.moodle.org/501/en/Git_for_Administrators
BTW, I'd highly recommend branches and not tags.

".... If I can't get help here, then I may try to hire a consultant to help me figure it out."

Might find some help at Fiver
https://www.fiverr.com/gigs/moodle

The thing about that though ... that's never going to end ... dunno that this would be true but your boss might wonder why!!!!

And if going that route, why not setup a Ubuntu box and let someone remote in to install the moodle for you on Linux.

'Spirit of Sharing', Ken

Rata-rata penilaian:Useful (1)
Sebagai balasan Ken Task

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Ken Task -
Gambar dari Particularly helpful Moodlers

Follow up on own posting ... Ok, I know I said one response and then no more, but as I re-read your posting, you mentioned VM - a virtual machine. ".. .a fresh Windows Server 2025 VM"
What's the VM?  Yes, one can run a local VM with Azure.
Interesting to note that, according to folks who keep track of that stuff, 60% of the customer compute cores are running Linux workloads ... on Ubuntu.

Again ... 'Spirit of Sharing', and this time will be last! senyum. Ken

Rata-rata penilaian:Useful (1)
Sebagai balasan Ken Task

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh George Mazevski -
Ken,

I appreciate the comments and the humor. If we didn't have everything Microsoft, then I would certainly by open to an Ubuntu Linux configuration. Unfortunately, we literally have zero Linux experience.

Ironically, in the short-term, we are going to use a packaged Moodle 4.5.7 instance offered by one of our external hosting providers and we will eventually deal with the headaches of migrating from 4.5.7 to 5.3. It is just unfortunate that I would have preferred to host the instance on one of our own VMs within our own internal datacenter environment. Oh well...
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh James Steerpike -
Gambar dari Particularly helpful Moodlers

From Moodle Requirements

...... Moodle 5.1 introduces a new "/public" directory. Your web server now needs to be configured so that its document root points to this /public directory, rather than the main Moodle folder.

If you can manage that on IIS, 5.1 should not be too difficult. The long term release is still a good option though.

Our documentation in Windows is pretty dire. Windows is not my choice but a Windows Server ( quite different from a Windows desktop) is capable of running a capable Moodle and if you have Windows Server knowledge, a sensible choice. Perhaps you can help on revising some of our docs.

Rata-rata penilaian:Useful (1)
Sebagai balasan James Steerpike

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh George Mazevski -

Hi James,

Sorry for being brief. I had typed in a long response here but the forum crashed when I tried to submit sedih

Anyway, I would be happy to help with Windows documentation once I have more time to study the Moodle software code and understand why my installation attempts were failing. Unfortunately, this probably won't be for a few weeks or so as I don't have time to work through these issues now.

In the short term, we are going to use a pre-packaged deployment of Moodle 4.5.7 offered by one of our external hosting providers. I hope that, eventually, we will be able to bring the instance "in-house" within our own datacenter environment. 

Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Ken Task -
Gambar dari Particularly helpful Moodlers

Well, if you insist on being a 'masochist' ... sedih

We know Ken doesn't run windows ... but he can Google!

I read your doc ... looks like you've done nothing wrong.

Key item ... document root for 5.1 needs to point to \path\to\documentroot\public\ if Moodle is the first thing to be seen via a browser.

If moodle code is in a directory and that directory isn't document root, then a symlink needs to be created that points to \public\.  URL to site would then be https :// site/thesymlink  One cannot point any browser directly to public.

There is an alternative to installing via Web ... it's using command line. According to Google, there is a php.exe which is the same as linux php-cli.

C:\php8x\php.exe C:\Moodle\admin\cli\install.php

You should be prompted for the same things the GUI did, only difference ... IIS isn't involved.
The db tables will be generated and a config.php file will be created in code root: C:\Moodle\.   In linux, since one might have done the above as root user, the config.php
file just needs an ownerships/permissions tweak.  The config.php file has to allow all users the ability to read the file - not write, and not execute.

Don't know if one can do this in Windows, but can in linux .... if the install failed for some reason and shows an error, the error can be fixed, and the install.php script can be run again ... matter of fact, many times it picks up where is left off ... AND completes!

Good luck!

Sorry ... gotta say this ... there are fewer steps to setting up a LAMP box in Linux.   And if one needs a panel, there are free panels (Cockpit/Webmin come to mind) that can help with most things linux server does.   Nice thing about those panels .. they have their own web service/port ... so if apache/nginx not working, Cockpit/Webmin is and through a combo of tool usage one can figure out the issue.

Sorry again ... SOAP box!   Just can't help myself!  I sure am 'Sorry', aren't I!!!!!! sedih

'SoS', Ken

Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Ken Task -
Gambar dari Particularly helpful Moodlers

Hmmmm ... after re-reading ...

According to Google, default IIS document root is in 

C:\inetpub\wwwroot\

You said you had successfully installed a 4.5.highest ... on that same machine?   So what's in C:\inetpub\wwwroot\?

And, since this is a tinker machine, what is the URL to the site?

https://site/

5.1 of moodle wants to rule the roost ... no other web based software can run in a FQDN site.   So if you have the 4.5.highest site still running in C:\inetpub\wwwroot\ and you are trying to install a 5.1 in another directory outside of document root, the url to it would be https://site/moodle/.  Is that right?   Using the same FQDN as the 4.5 which is located at C:\inetpub\wwwroot\?

'SoS', Ken

Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Rick Jerz -
Gambar dari Particularly helpful Moodlers Gambar dari Testers
As an idea, have you tried creating a symbolic link file (if it is possible with Microsoft IIS).

From your /wwwroot folder, try the following command:

ln -fs /public moodle

Then go to www.yourdomain.com/moodle and see what happens.
Sebagai balasan George Mazevski

Fresh Moodle 5.1 installation using IIS, PHP, & MariaDB

oleh Petr Skoda -
Gambar dari Core developers Gambar dari Documentation writers Gambar dari Particularly helpful Moodlers Gambar dari Peer reviewers Gambar dari Plugin developers

Last time I installed IIS was about 20 yours ago, but likely it did not change much since then. I would guess that you failed to configure the site's Physical path to point to the \public\ subdirectory in your Moodle 5.1 checkout.

The installation steps should be something like:

  1. extract Moodle 5.1 zip (or use git) into D:\Projects\moodle51\
  2. fix permissions to allow IIS users (not sure what it is called exactly) account to have read and execute permission in D:\Projects\moodle51\ and subdirectories
  3. create a new site (or update default site) with "Physical path" pointing to D:\Projects\moodle51\public\
  4. set up PHP in IIS the usual way (do not use PHP 8.5 yet)

I personally would not dare to use Windows for any kind of Moodle hosting or even testing, you will hit big problems sooner or later...