Installation on Windows
Please see below for instructions on how to install TestRail on a Windows Server system. See the requirements to learn more about the supported operating and server systems.
Preparing the server
As TestRail is a web application (based on PHP), TestRail requires a web server, a database (SQL Server or MySQL) and a working PHP environment to be installed on the server. On Windows Servers, TestRail works best with Microsoft's IIS web server and PHP configured to run with FastCGI. The easiest way to install PHP on Windows is to use Microsoft's Web Platform Installer.
To install PHP with the Web Platform Installer, select the Products tab at the top of the window and select the following packages (by pressing the Add buttons next to the packages):
- PHP 5.6.x
- Microsoft Drivers 3.0 for PHP 5.6 for SQL Server in IIS
The SQL Driver package is required by TestRail to connect to SQL Server databases. It's recommended to install the package even if you plan to use TestRail with a MySQL database. Now install both packages and all dependencies (such as IIS itself) by clicking the Install button. Please make sure to install the full IIS Edition and not IIS Express.
If you don't want to use the Web Platform Installer to install PHP, Microsoft also explains how to install PHP manually on IIS 6 and IIS 7. Also, if you plan to use a SQL Server database (instead of MySQL), also install the Microsoft SQL Server Driver for PHP when installing PHP manually. The driver needs the SQL Server Native Client to be installed (this is installed automatically for you when you use the Web Platform Installer).
Installing the prerequisites
TestRail has been designed to have as few dependencies on external applications and PHP extensions as possible to make it run on various operating systems and platforms. To use TestRail on Windows with a MySQL or SQL Server database, the following PHP extensions are required:
mysqlPHP extension to access MySQL databases
sqlsrvPHP extension to access SQL Server databases
curlPHP extension to check for updates etc.
jsonPHP extension for config files and integrations
mbstringPHP extension for working with Unicode strings
ioncubePHP loader to decode the TestRail PHP files
If you installed PHP with the Web Platform Installer as described above, all extensions but the
ioncube loader are already installed and activated. If you installed PHP manually, you might have to activate the required extensions in the PHP.ini file like this:
extension=php_mysql.dll extension=php_sqlsrv.dll extension=php_curl.dll extension=php_json.dll extension=php_mbstring.dll
The last required PHP extension is the free ionCube PHP loader. You can download the ionCube loader for Windows here (you might need a different version if you didn't install PHP via the Web Platform Installer):
After downloading and extracting the files on your server, copy the loader extension for your PHP version (e.g.
ioncube_loader_win_5.6.dll) to your PHP's ext directory (usually C:\Program Files (x86)\PHP\v5.6\ext or similar). Now activate the extension by adding the following line to your PHP.ini file (please adjust the directory accordingly and use two backslashes as directory separator). You must specify the full path to the file. You can find the PHP.ini file in your PHP installation directory (usually C:\Program Files (x86)\PHP\v5.6 or similar):
zend_extension="C:\\Program Files (x86)\\PHP\\v5.6\\ext\\ioncube_loader_win_5.6.dll"
You can verify that the ionCube loader extension has been successfully installed by running
php -v in the Windows Command Prompt (you need to change to PHP's installation directory in order the execute this command).
The ionCube loader extension is successfully installed if
php -v outputs something like this (note the ionCube PHP Loader line):
PHP 5.2.10 (cli) (built: Jun 17 2009 16:06:30) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd.
To reload PHP, you now need to restart the IIS web server. The easiest way to do is to restart the World Wide Web Publishing Windows service. You can do this by opening the Services application from the Administrative Tools and restarting the service (please note that this restarts all IIS application pools and websites; if you are hosting other websites and applications on this server, you might want to restart the relevant application pool only).
Creating the empty TestRail database
TestRail's installer will automatically create all needed database tables and initial data in the next step, but you first need to create an empty database and database user. You can either use a MySQL or SQL Server database when you install TestRail on Windows. Please refer to the Creating a MySQL database topic on how to do this on a MySQL database, as we will only cover SQL Server in this guide.
You can either install the free Microsoft SQL Server 2008 Express edition or use a full SQL Server installation. If you download the Express edition, make sure to download and install the version with Advanced Services, as it is very likely that TestRail will make use of the database's full-text search feature in the future. Also make sure to use Mixed Mode Authentication, as this is required by TestRail. After installing the database and management tool (Management Studio), continue with creating an empty database and user.
To create the empty TestRail database, start the SQL Server Management Studio, then right click Databases in the left tree and select New Database.
Now create a new TestRail login by expanding Security in the left tree, right clicking Logins and selecting New Login. You need to specify SQL Server authentication as the authentication method, specify a password and unselect all three password checkboxes below:
SQL Server distinguishes between server logins and database users, so in order to access the TestRail database with the newly created login, we also need to add a user to the database. To do this, expand the TestRail database in the left tree, expand Security, right click Users and select New User. Specify the user name and login name and make sure to assign the
db_owner role to the user.
To install the actual application, just upload and extract the TestRail installation archive to your web server and copy the files to your web server's
wwwroot directory (e.g.,
C:\inetpub\wwwroot). Alternatively you can set up a virtual directory in IIS and install the TestRail files in another location.
Then just point your web browser to the new
testrail directory on your web server to launch the TestRail Installation Wizard (e.g.
http://<server>/testrail/) and follow the instructions.
testraildirectory in Explorer, right-click, Properties and then select the Security tab. If the IIS user isn't listed, click Add, enter the IIS user (
IUSRunder Windows 2008 and later,
IUSR_<hostname>under Windows 2003) and confirm with OK. Then check the Read & Execute, List Folder Contents and Read permissions. Also important: click the Advanced button and check the "Replace permission entries on all child objects with entries shown here that apply to child objects". Now close all dialogs by clicking OK.
The installer will ask you to specify directories to store attachments, reports and log files. Please create those directories and make sure that the directories are writable by the web server. With the attachment and report directories, also make sure that they aren't directly accessible with a web browser for security reasons, so specify a directory outside your
wwwroot directory (for example,
C:\TestRail\Attachments). To make the directories writable by IIS, add the IUSR user to the security settings of the directories and grant full permissions to this user (on Windows Server 2003 systems, the user is usually called IUSR_<hostname>):
Activating the TestRail background task
The last step of the TestRail installation consists of installing the background task. The background task is responsible, among other things, for sending out email notifications for test changes if this feature is enabled. The background task needs to be triggered in regular intervals to do its work and the easiest way to do this under Windows is to create a scheduled task.
Before scheduling the task, you can verify that the background task can be successfully started by running it manually from the command line (x86 and x64):
> "C:\Program Files\PHP\v5.4\php.exe" "C:\inetpub\wwwroot\testrail\task.php" > REM Or, for x64 systems: > "C:\Program Files (x86)\PHP\v5.4\php.exe" "C:\inetpub\wwwroot\testrail\task.php"
The TestRail background task automatically detects if it's already running, so it's best to trigger the task in very short intervals (such as every minute) for best results. To do this, open the Windows Task Scheduler and select Create Basic Task (Windows 2008). Now specify a task name and select to trigger the task even if no user is logged on:
On the Triggers tab, add a new trigger to specify when the task should be executed:
And last but not least, add the action to execute the TestRail task script on the Actions tab. As the script is a PHP script, we need to specify the path of the php.exe and the task.php script as an argument (including quotes):
Alternatively to using the Task Scheduler GUI, you can also create the task using the command line. For example, on Windows Server 2008:
> schtasks /create /np /sc minute /mo 1 /tn "TestRail Background Task" /tr "\"C:\Program Files\PHP\v5.4\php.exe\" C:\inetpub\wwwroot\testrail\task.php" > REM Or, for x64 systems: > schtasks /create /np /sc minute /mo 1 /tn "TestRail Background Task" /tr "\"C:\Program Files (x86)\PHP\v5.4\php.exe\" C:\inetpub\wwwroot\testrail\task.php"
That's it! If everything worked, your TestRail installation is complete and you can start using the application by accessing it with your web browser, i.e.: