Installation for Windows 2003 with IIS
Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Installation for Windows 2003 with IIS.
- Return to Windows installation
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 iis-aid.com 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  and install
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:
- Setup PHP on the web server
- Install FastCGI on the web server
- Configure the PHP script mapping in IIS
- Create a Moodle application in IIS
- Configure PHP to work with Microsoft SQL Server 2005
- Create the Moodle database and database login
- Check the PHP configuration - if PHP is not working or has not been configured correctly Moodle will not install.
- Install Moodle
- Install and configure URL rewriting extension (see below)
- Setup a Moodle Cron Job
Detailed instructions on how to perform each of the above steps is available on www.moodlewindows.za.net.
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"?> <configuration> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="134217728" /> </requestFiltering> </security> </system.webServer> </configuration>
URL rewriting / Slasharguments
In order to use html resources or SCORM packages you need to configure URL rewriting. The features is not available in IIS, you need to install a 3rd party extension for that - see list in http://msdn.microsoft.com/en-us/library/ms972974.aspx
Please note that this is not an issue when using IIS7 - it appears to support 'slash arguments' by default.
You can use following simple URL rewriting rule:
RewriteRule ^([^\?]+?\.php)(\/.+)$ $1\?file=$2 [QSA]
Theoretically you might configure PATH_INFO server variable, but it is not reliable especially when using unicode file names.
Using Moodle discussions: