php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39319 Problem to connect to SQLSERVER 2005
Submitted: 2006-10-31 11:03 UTC Modified: 2006-11-02 17:42 UTC
From: luiscervantesjane at hotmail dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 5.1.6 OS: WINDOWS 2003
Private report: No CVE-ID: None
 [2006-10-31 11:03 UTC] luiscervantesjane at hotmail dot com
Description:
------------
The web server are running in windows 2003, Version  Apache/2.0.55 (Win32) PHP/5.1.6. And when I try to connect to MSSQL 2005 over windows2003, I can`t.
If the code move to another server windows 2000, with the same Apache Version, PHP 5.1.6. The connection is OK.

I belive that there are a problem the connection with SO windows2003 where are running php.
Thanks

Reproduce code:
---------------
$SERVER="SATURNO\SATURNO";
$USER="USER";
$PASSWD="PASSWORD";
$link = mssql_connect($SERVER, $USER, $PASSWD) or die ("Could not connect MSSQL");
mssql_select_db($DATABASE,$link) or die ("Could not select database " . $DATABASE. " in MSSQL");
$query = "Select * form TABLA";

$result = mssql_query($link,$query);
while ($row = mssql_fetch_array($result)){
	print $row['ALU_NOMBRE'] . "<bR>";
}

Expected result:
----------------
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: SATURNO\SATURNO in C:\WEB\PRUEBAS\SQL2005\index2.php on line 5
Could not connect MSSQL


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-31 15:45 UTC] fmk@php.net
The MSSQL extension uses ntwdblib to connect to the server. This Microsoft library can be configured with Netbios or TCP/IP as the default library.

Use the Client Network Tools to specify the default protocol and to create server aliases. A server alias can be defined to use a specific host name and port numbr and you can use the alias as the first parameter to mssql_connect().
 [2006-11-02 09:34 UTC] luiscervantesjane at hotmail dot com
Hi.
Who can I configure this?
Have I to install Client Network Tools in the server web o reconfigure the Client Network Tools has is installed in the MSSQL.

I have runnig other web server (XP Pro) and move the code in the other PC and the connection is right. Do you know why..

Thanks
 [2006-11-02 17:42 UTC] fmk@php.net
The client tools are installed on the MSSQL server by default. 
If the Web server and MSSQL server are running on the same box there is no need for special actions.
If the web server is running on another box you can install the client tools from the CD on the web server.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC