php.net |  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
Votes:3
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-01-18 09:06 UTC] tank dot is dot hank at gmail dot com
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] kalle@php.net
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 asp.net application in the same environment which runs perfectly 
fine with and without encryption.
 [2013-07-10 05:52 UTC] pajoye@php.net
IIRC:

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 
(http://pecl.php.net/sqlsrv) 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.

extension=php_curl.dll
extension=php_dblib.dll
extension=php_gd2.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_openssl.dll
extension=php_pdo.dll
extension=php_pdo_sqlsrv_53_nts_vc9.dll
extension=php_sqlsrv_53_nts_vc9.dll
extension=php_xmlrpc.dll
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC