Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Installation for Windows 2003 with IIS.

Installation for Windows 2003 with IIS

From MoodleDocs
Revision as of 06:40, 9 May 2012 by Helen Foster (talk | contribs) (Installing Moodle template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

We'll use Internet Information Services (IIS) as the web server and MySQL as the database server. Note: Microsoft SQL Server 2005 and up is also supported.

We're assuming that IIS has been installed on the server and that the reader of this text is familiar with IIS configuration.

PHP also needs to be running on the server. See How to install PHP 5.x on Windows Server 2003 with IIS 6 for instructions on how to install the thread-safe version of PHP with the ISAPI extension. But, instead of that PHP/ISAPI combination, you should rather consider installing the non-thread-safe version of PHP with the FastCGI component from Microsoft. There are several legitimate claims that this is a much better and faster way to run PHP and that performance will be much better. Read the Difference between PHP thread safe and non thread safe binaries article on for more details.

Another reason why it is best to use FastCGI instead of the ISAPI extension if you are using IIS 7 is that the FastCGI component is already built-in to Microsoft IIS 7 (although it is not enabled by default so you have to manually enable it in the Server Manager).

A link to an article on how to setup PHP (non-thread-safe) and FastCGI on IIS 6 is available in the next section below.

NOTE: Before installing Moodle you should make sure that PHP is running properly i.e. that IIS can serve .php scripts and that PHP can connect to your database server. Many new Moodle administrators experience problems installing Moodle because PHP has not been configured properly and they mistakingly believe that they're doing something wrong with the Moodle installation (when the problem actualy is with the PHP configuration).

One way to check that PHP is configured properly is to run the phpinfo() command and then check the output that it produces. Part of this output is information about how PHP will connect to the web server and the database. Many Moodle administrators have to resort to posting desperate pleas for help in the Moodle forums because they have not checked the output of phpinfo() and are unable to install Moodle because of a PHP configuration problem.

MySQL: download from [1] and install

Finally, get the Latest Stable Build of the Standard Moodle Distribution from and read the rest of the Windows installation documentation.

Installation for Windows Server 2003 with IIS and a MSSQL database

The above instructions will help you setup Moodle with MySQL. But what if you want to (or have to) use MSSQL as your database engine?

Installing Moodle on Windows Server 2003 with IIS and MSSQL 2005 is a 9 step process:

  1. Setup PHP on the web server
  2. Install FastCGI on the web server
  3. Configure the PHP script mapping in IIS
  4. Create a Moodle application in IIS
  5. Configure PHP to work with Microsoft SQL Server 2005
  6. Create the Moodle database and database login
  7. Check the PHP configuration - if PHP is not working or has not been configured correctly Moodle will not install.
  8. Install Moodle
  9. Install and configure URL rewriting extension (see below)
  10. Setup a Moodle Cron Job

Detailed instructions on how to perform each of the above steps is available on

If you are installing on IIS 7 (Vista / Server 2008), and have updated the post_max_size and upload_max_filesize settings in php.ini to allow for large file uploads, you will also need to configure the maxAllowedContentLength setting in IIS7 to be at least as great as the values that you have set. You can do this by creating a web.config file in your Moodle html directory containing the following text:

<?xml version="1.0" encoding="UTF-8"?>
                <requestLimits maxAllowedContentLength="134217728" />  

This will set the maximum file upload size to 128MB. The default is 30000000 (30MB) [2] [3].

URL rewriting / Slasharguments

In order to use html resources or SCORM packages you need to configure URL rewriting. The features is not available in older IIS versions, you need to install a 3rd party extension for that - see list in PHP installer from should install URL Rewrite 2.0 automatically.

You can use following simple URL rewriting rule:

RewriteRule ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]

Or when using URL Rewrite 2.0:

Rewrite rule - Internet Information Services (IIS) Manager.png
  • Matches the Pattern - Regular Expressions - ^([^\?]+?\.php)(\/.+)$
  • Action - Rewrite - {R:1}\?file={R:2} - Append query string

Newer IIS and PHP versions support standard PATH_INFO server variable, unfortunately it uses legacy single-byte charsets which makes it unusable for non-ascii file names.

See also

Using Moodle discussions: