The Grayzone

Setting up MantisBT on IIS 7 w/ SQL Server

I recently decided to give a new Bug Tracking system a try and after some reading decided to go with Mantis as it is web based, Open Source, lightweight and easy to use.

I decided to host it locally with IIS 7 on my Windows 7 development machine, using Microsoft SQL Server 2008 R2 Express as the database. I chose MSSQL as the database as I already had it installed on my machine.

The steps that are required to get Mantis running on Windows are fairly straightforward and consist of:

  1. Install PHP on IIS.
  2. Setup Mantis.
  3. Track bugs!

However I found a lot of articles on the internet with people having issues setting up Mantis on Windows so I thought I would put down how I did it to try and help anyone else with similar issues.

Install PHP on IIS

This was a lot easier than I thought it would be, go through the following steps and you’ll be good to go:

  1. The initial steps are to enable FastCGI in IIS and configure IIS to process PHP requests. These are pretty simple and detailed in this article on php.net.
  2. Next you need to download PHP for Windows. I downloaded the zip file of PHP 5.3.6 “VC9 x86 Non Thread Safe” version from http://windows.php.net/download/.
  3. After downloading the zip file, unzip it to a location on your local computer, I used C:\PHP.
  4. Most documentation I found stated that I would need php_mssql.dll in order for PHP to use MSSQL. It turns out that PHP 5.3 doesn’t support this anymore. Fortunately there is a Microsoft PHP driver for MSSQL, available for download here.
  5. Extract the dlls from the above executable, I unzipped them to an MSSQL folder within my PHP install folder (C:\PHP\MSSQL). Copy php_sqlsrv_53_nts_vc9.dll from the extracted files and paste it into the php “ext” folder (C:\PHP\EXT).
  6. The final step is now to enable the above dll for PHP to be able to use it. You can do this by either adding into the following your php.ini file or using the “Enable or disable an extension” option in PHP Manager for IIS 7:
    [PHP_SQLSRV_53_NTS_VC9]
    extension=php_sqlsrv_53_nts_vc9.dll
    

Now that PHP is installed, setup in IIS and the relevant drivers installed the next step is to setup Mantis.

Setup Mantis

Setting up Mantis was also pretty straightforward, the only possibly tricky part is setting the Database connection options.

  1. First download the zip file of the latest release of Mantis Bug Tracker from http://www.mantisbt.org/download.php, currently 1.2.4.
  2. Unzip this to any location. Copy the contents of the mantisbt-1.2.4 folder to C:\Inetpub\wwwroot\mantis\ (or change if the location of your root directory is different).
  3. Before setting up the configuration file for Mantis you need to create a DB and a User. My database was called “mantisBT” and I created a user called “mantisdbuser”.
  4. Next you need to setup the configuration file for Mantis. To do this rename the file “config_inc.php.sample” to “config_inc.php”, then change the “Database Configuration” section. For the following my computername is “COMPUTERNAME” and MSSQL instance name is “EXPRESS”.
# --- Database Configuration ---
$g_hostname      = 'Driver={SQL Server};SERVER=COMPUTERNAME\EXPRESS;DATABASE=mantisBT;UID=mantisdbuser;PWD=mantisPassword;';
$g_db_username   = 'mantisdbuser';
$g_db_password   = 'mantisPassword';
$g_database_name = 'mantisBT';
$g_db_type       = 'odbc_mssql';
  1. The final step is to run the installation scripts to create all of the required Database tables. This will be at: http://localhost/mantis/admin/install.php. You will see a “pre-installation check” screen which will warn you of any problems that need looked at before you install the Database. You should now be good to go, navigate to http://localhost/mantis/ and login using the default username and password (administrator, root).

Share this: