Title: Install and configure IIS and PHP
Course: Establish and maintain an LMS > Section: 01 - Install and configure IIS and PHP

In this guide you will learn to install and configure both the HTTP server and the PHP interpreter using Microsoft’s own “Web Platform Installer” to which we will refer sometimes as WPI.

Then you will Install and configure the database server and create a database for moodle

Introduction

The Moodle software depends on three main software components on a server. These components are:

- HTTP server: this is the software that facilitates the communication between the user’s browser and the software (Moodle) in the system.
- PHP interpreter: Moodle is written in the PHP scripting language. Scripting means that its files are “human readable” and for a computer to run such a language, this human-readable code needs to be converted into computer code. The interpreter will do that.
- Database server: All data created by Moodle, like user information, logs, user interaction, etc needs to be stored somewhere in an organized way. The Database takes care of that.

In this guide you will learn to install and configure both the HTTP server and the PHP interpreter using Microsoft’s own “Web Platform Installer” to which we will refer sometimes as WPI.
Then you will Install and configure the database server and create a database for moodle

Prerequisites

- Configure windows using the instructions from the previous document.
- Active internet connection (preferably via cable, not wireless)
- Basic computer skills (Windows)

Install the Web Platform Installer, IIS and PHP

The Web Platform Installer is a tool to install web server related software directly from Microsoft’s servers. It makes the job of installing and updating software easier.

Instructions

Open your browser and go to https://www.microsoft.com/web/downloads/platform.aspx or just search the internet for “web platform installer”. This should be the first link.

Once in the WIP webpage, click “Install this extension”

For this example I am using Microsoft Edge as my browser. You can use other if you want but then the messages in the browser might differ.

Select Run in the Dialog:

Once the software starts, click “I accept…” and click “Install”

You will be presented with a UAC (User Account Control) window. This window will always appear when a software requires administrator access to the system. We will see this window often during the guides.
Click “Yes”.

Once the Installer is done, click “Finish”.

Now open the Start Menu and find the Web Platform Installer icon. Click on the icon.

One more time UAC will display the confirmation window. Click “Yes”.

On the WIP interface, type “php” in the search box and press enter on your keyboard.

You will be presented a long list of option. Look for the latest version of the PHP package. It should be called PHP 7.3.1 (x64). It is important that you choose the latest version (if you find one with a larger number you can choose it (e.g.: 7.4.1) but make sure you select the option marked with “x64” because Moodle prefers the 64 bit PHP.

Click the Add button beside your selection.

Now click on Options.

Un-select the box with the text “Yes, I am willing…” and under “Which Web Server would you like to use” select “IIS”. Then click OK.

Now click on the Install button.

Click in “I Accept” in the next window.

Now wait for WPI to install the software (this will take a few minutes, you can go have a coffee)

It’s likely that after the installation WPI will require you to re-boot the computer. Click Yes in the window.

After booting, you will see the UAC window one more time. Click “Yes”.

After WIP is finished installing the software you might receive the error below. You can ignore the problem and click “Finish”

And next, click on Exit.

If you want to check if your webserver is working, you can open the browser and visit the address: http://127.0.0.1 or http://localhost/ there you should see the screen below:

Configure PHP

For Moodle to be run smoothly we need to make sure that all the PHP settings are configured according to its requirements. This will be done by changing configurations on a text file.

Instructions

Click on the “Start Menu” icon and search for notepad (just start typing notepad after clicking on the start menu icon). Click with the right button of your mouse on the notepad icon and select “run as administrator”

Since running as administrator gives extra privileges to notepad, you will see the UAC window. Click “Yes”.

Now, on the notepad window, click “File” and then “Open”

Now browse to C:\Program Files\PHP\v7.3 (or later version in case you’ve chosen it in the previous step).

Select “All files” instead of “Text Documents” in the dropdown menu.

Select “UTF-8” for Encoding

Double click the “php” file with the cog icon (on the right side it should read “Configuration settings”) to open the file.

Go all the way down to the end of the text and add the three lines below:

extension=php_intl.dll

extension=php_fileinfo.dll

zend_extension=php_opcache.dll

Make sure you either copy and paste the text or double check that the text is typed precisely or you might encounter errors later.

Now click on “Edit” and then “Find…”

Type in “post_max_size” and click “Find Next”.
(If you can’t find it, change the direction from “Down” to “Up”)

Notepad will show you the line saying “post_max_size = 8M”

Change the text to “post_max_size = 1G”

Now perform a search again using the term “upload_max_filesize”

Change the value to “upload_max_filesize = 1G”

Now search for “max_execution_time” and change the value to “max_execution_time = 600”

Now click on “File” and then in “Save”

Then on “File” and “Exit”

The PHP interpreter is now configured to be used with Moodle.

You must now reboot the computer.