Manual:Installing MediaWiki on Windows Server 2016

The goal of this guide is to give some a quick and easy way to install MediaWiki on a Windows Server 2016 environment.

Requirements
The following items will be required:
 * Administrator permission
 * PHP Non Thread Safe Zip for Windows
 * MySQL or MariaDB
 * MediaWiki
 * Extration software such as Bandizip
 * Visual C++ Redistributable Packages or Visual Studio

Internet Information Services (IIS)
To install IIS follow the steps below:
 * 1) Open Server Manager, select Roles.
 * 2) Add the Web Server role and include the following:
 * Common HTTP Features -> HTTP Redirection
 * Application Development -> CGI.
 * 1) Once complete, open web browser and go to http://127.0.0.1/.

Set Default Document
Set default document to index.php.
 * 1) Open Internet Information Services (IIS) Manager and select the server name from the list.
 * 2) Go to Default Document.
 * 3) Add index.php and move it to top of the list.

Adding PHP as FastCGI application (after installing PHP)

 * 1) Open Handler Mappings
 * 2) Select Add Module Mapping... in the Actions pane.
 * 3) Add *.php as Request path.
 * 4) Choose FastCgiModule as Module from the drop down list.
 * 5) Add the path to the php-cgi.exe file in the Executable field. (C:\PHP\php-cgi.exe in this example)
 * 6) Add PHP_via_FastCGI as name.
 * 7) Open the Request Restrictions menu and select File or folder.

PHP
To install PHP follow the steps below:
 * 1) Install the Microsoft Visual C++ Redistributable.
 * 2) Extract the PHP zip into to a location of your choice. In this example C:\PHP is used.
 * 3) Create the php.ini file by opening the php.ini-production file and saving it as php.ini.
 * 4) Open your C:\PHP\php.ini file in Notepad and uncomment the values below by removing the semi colon symbol . Line numbers depend on version. Newer versions use the format  instead of   for the extensions.
 * 5) extension_dir = "ext" (Line 761)
 * 6) cgi.force_redirect = 1 (Line 778)
 * 7) cgi.fix_pathinfo = 1 (Line 798)
 * 8) fastcgi.impersonate = 1 (Line 810)
 * 9) fastcgi.logging = 0 (Line 814)
 * 10) extension=curl (Line 914)
 * 11) extension=fileinfo (Line 916)
 * 12) extension=gd2 (Line 917)
 * 13) extension=intl (Line 920)
 * 14) extension=mbstring (Line 923)
 * 15) extension=mysqli (Line 925)
 * 16) extension=openssl (Line 928)
 * 17) extension=pdo_sqlite (Line 934)
 * 18) extension=pgsql (Line 935)
 * 19) extension=sockets (Line 943)
 * 20) extension=sqlite3 (Line 945)
 * 21) Edit permissions on the images directory of the MediaWiki installation and add IUSR with modify privileges.
 * 22) Edit permissions on the temp directory of windows (C:\Windows\Temp) and add IUSR with modify privileges.
 * 23) Create a file called C:\inetpub\wwwroot\phpinfo.php, include the lines below.
 * 24) Open web browser and access http://127.0.0.1/phpinfo.php, it should bring up a PHP information page.
 * Contents of file PHPInfo.php

MySQL
To install MySQL follow the steps below:
 * 1) Launch the installer, select Server only.
 * 2) After the installer finishes installation you will be prompted to run the MySQL Server Instance Configuration Wizard.
 * 3) Select Server Machine, then click Next
 * 4) Confirm Enable TCP/IP Networking and Add firewall exception for this port are checked, then click Next.
 * 5) Enter in root password, then click Next.
 * 6) Confirm Install as Windows Service is checked, then click Next.

MariaDB
To install MariaDB follow the steps below:
 * 1) Launch the installer and continue to Default instance properties.
 * 2) Enter in root password, then click Next.

MediaWiki
To install MediaWiki follow the steps below:
 * 1) Extract the media wiki archive into C:\inetpub\wwwroot\mediawiki directory.
 * 2) If you have just one .tar file, extract that file into the C:\inetpub\wwwroot\mediawiki directory.
 * 3) If you want MediaWiki to be the default website follow the optional instructions below.
 * 4) Configure MediaWiki by accessing the configuration URL.
 * 5) Follow guide for using the configuration script.  Ignore the GNU diff3 not found error.

Create specific IIS website for MediaWiki (Optional)
Configure MediaWiki as the default website for a host name or an IP address.
 * 1) Select a name for the web site.
 * 2) Rename the C:\inetpub\wwwroot\mediawiki folder to C:\inetpub\wwwroot\[web site name].
 * 3) Open the Internet Information Services (IIS) Manager, open the server name from the list.
 * 4) Right click on Sites and choose Add Web Site....
 * 5) Enter the web site name in the Site Name field.
 * 6) Change the physical directory to C:\inetpub\wwwroot\[web site name].
 * 7) Add a host name for your website or select an IP address.
 * 8) Click OK to create the web site.

GNU diff3 Installation (Optional)
Install GNU diff3 files. Original LocalSettings.php $wgDiff3 = ""; Updated LocalSettings.php $wgDiff3 = "C:/Program Files (x86)/GnuWin/bin/diff3.exe"; $wgMimeDetectorCommand = "C:/Program Files (x86)/GnuWin/bin/file.exe -bi";
 * 1) Create directory GnuWin in C:\Program Files (x86).
 * 2) Navigate to DiffUtils website.
 * 3) Download the file diffutils-2.8.7-1-bin.zip.
 * 4) Extract to the C:\Temp directory.
 * 5) Copy the bin directory to C:\Program Files (x86)\GnuWin.
 * 6) Navigate to File website.
 * 7) Download the file file-5.03-bin.zip.
 * 8) Extract to the C:\Temp directory.
 * 9) Copy the bin directory to C:\Program Files (x86)\GnuWin.
 * 10) Update the LocalSettings.php located in C:\inetpub\wwwroot\[media wiki name].
 * 1) Path to the GNU diff3 utility. Used for conflict resolution.
 * 1) Path to the GNU diff3 utility. Used for conflict resolution.
 * 1) Use external mime detector

Common Errors

 * No styling when installing MediaWiki: Set the permissions for the temp directory of windows (C:\Windows\Temp) and add IUSR with modify privileges.
 * IIS 500 Error code: Install the Microsoft Visual C++ Redistributable.