Author Topic: Roundcube with IIS7, SQL 2008  (Read 7514 times)

Offline Greg

  • Newbie
  • *
  • Posts: 2
Roundcube with IIS7, SQL 2008
« on: February 13, 2009, 10:38:00 AM »
My configs:

Server 1:
Windows Server 2003 Standard SP2 (IIS6)
SQL Server 2008 Express (w/Tools)
PHP 5.2.6 ISAPI (thread-safe)
Roundcube 0.2-beta
hMailServer 4.4.3-B285

Server 2:
Windows Web Server 2008 (IIS7)
SQL Server 2008 Express (w/Tools)
PHP 5.2.6 FastCGI (non-thread-safe)
Roundcube 0.2-stable
hMailServer 5.0-B326

Following the post by JabbaTek here I managed to successfully set up Roundcube with hMailServer at the end of last year (Server 1 above) with the exception of using SQL 2008 instead of 2005. This server performs without issue.

Now I am trying to do the same thing but with Windows Server 2008 (IIS7) and I have ran into a problem which I have been trying to solve for hours. No matter what I do on Server 2, Roundcube refuses to connect to the database. Extract from log:
Quote
[13-Feb-2009 14:15:18 +0000] DB Error: _doConnect: [Error message: unable to establish a connection]
 ** mssql(mssql)://roundcube:xxx@MAILSVR\MAIL/roundcube in C:\inetpub\wwwroot\webmail2\program\include\rcube_mdb2.php on line 93 (GET /webmail2/)


Server name: MAILSVR
SQL Instance: MAIL
Database: roundcube
User/pass is correct

Alternate error:
Quote
DSN (write): NOT OK  (MDB2 Error: connect failed)

Make sure that the configured database exists and that the user has write privileges
DSN: mssql://roundcube:mypass@MAILSVR\MAIL/roundcube


However, when I point Server 1 to the database on Server 2 it connects without issue, I can log in no problem. Therefore I believe the SQL side of things is configured correctly, but something is wrong with either IIS7, PHP, or the Roundcube config on Server 2 which prevents it from attempting to connect to the database on Server 2 (it also refuses to connect to the database on Server 1).

Things I have tried:
- Different configs of PHP (5.2.6, 5.2.8, ISAPI/FastCGI/thread-safe/non-thread-safe)
- Roundcube 0.2-beta and 0.2-stable
- Ran through the Roundcube installer to verify all required components are 'OK'

Does anybody have any ideas on how to get this working? I'm very new to IIS7 so I could be missing something, I find the permissions particularly confusing. :cool:

Offline Greg

  • Newbie
  • *
  • Posts: 2
Roundcube with IIS7, SQL 2008 - working
« Reply #1 on: February 16, 2009, 06:23:06 AM »
I found the solution to my problem. The version of ntwdblib.dll that is supplied with the PHP download does not support MSSQL 2005/2008. Once I replaced it with a newer version the connection to the database can be made successfully.

For reference:
ntwdblib.dll (version 2000.02.08 ) - does not work
ntwdblib.dll (version 2000.80.194.0) - works

Also upgraded to PHP 5.2.8 (non-thread-safe) running FastCGI under IIS7 with no issues. :)

Offline jamest_jt

  • Newbie
  • *
  • Posts: 1
Roundcube with IIS7, SQL 2008
« Reply #2 on: February 16, 2009, 10:12:35 AM »
Hi Greg,
I am having a similar setup like your server-2. However, I encounter the
problem of cannot send attachment with more than 2M, whenever
I click the "send", the mail and attachment are sent but the
sending message remains forever and the sent mail is never saved
in the "sent" box. On the other hand, sending mail with attachment of less than 2M is successful. Had tried all the setting in the php ini files but
does not seem to work at all. I am stucked with the setup (last steps) for
weeks. Please enlighten.
Thanks from James

Offline Joseph

  • Newbie
  • *
  • Posts: 1
Roundcube with IIS7, SQL 2008
« Reply #3 on: March 06, 2009, 10:55:38 PM »
I am having the send issue too on IIS7
I am workingon a fix now but I could use a little help on this.
I think that it is a permissions issue but where I do not know yet

Can anyone tell me what permisssion are needed on what folders please

any feedback qould be great

thanks
Joseph
« Last Edit: March 06, 2009, 10:58:12 PM by Joseph »