|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-18 14:48 UTC] claudio_reis at aeiou dot pt
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Description: ------------ The code used to create a connection to a MS SQL database works fine when running under a webserver (IIS 6.0) but fails when running from a command line. I used the same file in both scenarios to be 100% sure. Using the netcap2 tool i found that when running as a command line(or task) it tries to comunicate to the ms sql server using SMB protocol and tries to do a tree connect. The sql server responds with a STATUS_BAD_NETWORK_NAME. Result the connection cannot be done. When running in the webserver context it queries the dns for the server ip then it stablish a connection to the 4414 port(ms-sql-m). Why this strange behaviour? Thanks for your help. Other info that can be usefull PHP VERSION: PHP-5.2.9-2 MS SQL SERVER: SQL Server Enterprise Edition 8.00.2184(SP4) Microsoft Windows NT - 5.0(2195) Windows Server: MS Windows Server 2003 R2 SP2 php.ini: [MSSQL] mssql.allow_persistent = On mssql.max_persistent = -1 mssql.max_links = -1 mssql.min_error_severity = 10 mssql.min_message_severity = 10 mssql.compatability_mode = Off Reproduce code: --------------- /* connection string ommited for security reasons */ if ($con = mssql_connect("SERVER","USER","PASSWORD")){ print("YES");} else{ print("NO")} Expected result: ---------------- YES Actual result: -------------- can't connect to server