|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43888 mssql_connect fails with an SSL enabled SQL server
Submitted: 2008-01-18 09:06 UTC Modified: 2013-07-10 05:52 UTC
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: tank dot is dot hank at gmail dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.2.5 OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
43 - 18 = ?
Subscribe to this entry?

 [2008-01-18 09:06 UTC] tank dot is dot hank at gmail dot com
mssql_connect stopped working after we enabled SSL on our SQL server. The only error message we are getting is: 
Warning: mssql_connect(): Unable to connect to: OURSERVER.local in C:\site\DB.php on line 82

A sniffer shows it is able to open a connection to the server, but after a couple of seconds the connection is closed. We are able to connect using SQLCMD.EXE

Reproduce code:
mssql_connect('OURSERVER.local', 'myuser', 'mypass');

Actual result:
Warning: mssql_connect(): Unable to connect to: OURSERVER.local in C:\site\DB.php on line 82


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-18 12:26 UTC] hack dot is dot tank at gmail dot com
An ODBC connection seems to work, which I believe will fix the problem for me.
 [2009-01-07 18:07 UTC]
Have you set the mssql.secure_connection ini option to true?
 [2009-01-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2013-07-10 05:35 UTC] arif dot shah at apperception dot co dot uk
I am having the same problem.I have 'mssql.secure_connection' enabled but if I 
am not wrong this is irrelevant as the comment in php.ini refers to this with NT 
Authentication. I am using SQL Server authentication.

If I turn 'Force Encryption' off at SQL Server then everything works fine.

My config is as below:
Web Server: Windows 2008, IIS 7, PHP 5.3.10 x64 CGI/FastCGI
DB Server: Windows 2008, SQL Server 2012, Mixed Authentication

I also have an application in the same environment which runs perfectly 
fine with and without encryption.
 [2013-07-10 05:52 UTC]

We do not support PHP 5.2 anymore. MSSQL extension is not supported anymore either 
on 5.3+. We strongly recommend to move to the SqlSrv extension 
( developed by the SqlServer team itself.
 [2013-07-10 06:12 UTC] arif dot shah at apperception dot co dot uk
I am using PHP 5.3.10 and Microsoft's SQL Driver for PHP version 3.0 with following extensions enabled.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 23:01:27 2024 UTC