From:             claudio_reis at aeiou dot pt
Operating system: Windows Server 2003
PHP version:      5.2SVN-2009-08-18 (snap)
PHP Bug Type:     MSSQL related
Bug description:  mssql_connect:  Can't connect to database

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

-- 
Edit bug report at http://bugs.php.net/?id=49288&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49288&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49288&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49288&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49288&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49288&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49288&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49288&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49288&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49288&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49288&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49288&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49288&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49288&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49288&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49288&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49288&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49288&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49288&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49288&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49288&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49288&r=mysqlcfg

Reply via email to