This article describes how to install RoundCube on Windows 2008, IIS7 and SQL Server (MSSQL) 2012 with hMailServer. I couldn’t really find much out there regarding this setup so here are the steps:
Install PHP for IIS
- Install PHP using the web platform which will automatically configure IIS, a reboot may be required.
- This installs PHP 5.3 but for the PHP SQL Server 2012 drivers you’ll need 5.3.6 upwards so I updated to the latest version which at the moment is 5.4.4:
– Download the latest version http://windows.php.net/download
– Extract to C:\Program Files (x86)\PHP\v5.4.4
- Update IIS to use PHP 5.4.4
– In IIS Manager select your site, and in the IIS section select “PHP Manager”
– Next select “register new PHP version”, on the next screen navigate toC:\Program Files (x86)\PHP\v5.4.4\php-cgi.exe
– Next select “change PHP version”, on the next screen select v5.4.4
- Download RoundCube and extract to your target IIS folder.
- Give write permissions to the IIS user on folders “temp” and “logs” Enable SQL Server in PHP
- Download the PHP 3.0 Drivers for SQL Server (this includes support for 2012)
– http://www.microsoft.com/en-us/download/details.aspx?id=20098 (select SQLSRV30.exe)
– Run SQLSRV30.exe and extract files to C:\Program Files (x86)\PHP\v5.4.4\ext
- To enable SQL Server edit the php.ini file located in C:\Program Files (x86)\PHP\v5.4.4\php.ini
- Search for “extension=”, you should see the commented out section, add the following entry:
Check Your PHP Configuration (optional step)
- On the root of your RoundCube installation create a new info.php file with the following contents:
// Show all information, defaults to INFO_ALL
phpinfo();// Show just the module information.
// phpinfo(8) yields identical results.
- Navigate to the info.php file and check the stream for “SQLSRV”
- Create SQL Server Database
- You’ll need to manually create a new database, I called mine RoundCube
- Next run the provided script against the new db to create the schema, the MSSql script can be found here:
- Create a new sql server user and grant access to the RoundCube database
- Navigate to your website where RoundCube is located and run http://www.yourwebsite/installer
- On screen 1 click next to get to the config screen
– Select MySQL (don’t worry we’ll change this afterwards), I found that SQL server was not displayed in the list
– Update the application name, SMTP server
- Edit the \config\db.inc.php (located in RoundCube)
– Find the variable $rcmail_config[‘db_dsnw’] =
– Update to $rcmail_config[‘db_dsnw’] = ‘sqlsrv://user:password@localhost/RoundCube’;
- Progress to the check config screen and makesure the DB and write permissions are working
Remember to remove the info.php file and the installer directory!
Other useful things that you might like to do in RoundCube
– Cannot see the ‘Drafts’, ‘Sent’, ‘Junk’ and ‘Trash’ folder
By default these aren’t displayed/created, in config\main.inc.php edit the following:
$rcmail_config[‘create_default_folders’] = true;