#47072 [Com]: php crash when mssql_connect to remote MSSQLSERVER 2005 Standart Edition
| From: | bloodjazman at gmail dot com | Date: | Tue, 13 Jan 2009 09:19:12 +0000 |
| Subject: | #47072 [Com]: php crash when mssql_connect to remote MSSQLSERVER 2005 Standart Edition | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132819@lists.php.net to get a copy of this message | ||
ID: 47072
Comment by: bloodjazman at gmail dot com
Reported By: bloodjazman at gmail dot com
Status: Open
Bug Type: Reproducible crash
Operating System: Windows XP SP2
PHP Version: 5.2.8
New Comment:
Problem solved when change Default Language = English in properties SQL
Server Management Studio
Previous Comments:
------------------------------------------------------------------------
[2009-01-12 10:04:15] bloodjazman at gmail dot com
Description:
------------
i read all comments on
http://php.net/manual/en/function.mssql-connect.php
i have
developers machine
Windows XP SP2 (5.1.2600)
+ php 5.2.8 (and reproduce under php-5.2-win32-VC6-x86-latest.zip,
php-5.3-win32-VC9-x86-latest.zip)
ntwdblib.dll 2000.80.194.0 (and reproduce under ntwdblib.dll
2000.2.8.0)
and remote machine Windows 2003 SP1 + MSSQLServer 2005 Standart Edition
(version 9.0.1339)
---------------------
php.ini
mssql.secure_connection=off
php.exe -i | grep mssql
>
mssql
mssql.allow_persistent => On => On
mssql.batchsize => 0 => 0
mssql.compatability_mode => Off => Off
mssql.connect_timeout => 5 => 5
mssql.datetimeconvert => On => On
mssql.max_links => 50 => 50
mssql.max_persistent => 10 => 10
mssql.max_procs => 25 => 25
mssql.min_error_severity => 0 => 0
mssql.min_message_severity => 1 => 1
mssql.secure_connection => Off => Off
mssql.textlimit => Server default => Server default
mssql.textsize => Server default => Server default
mssql.timeout => 60 => 60
when try running reproduction code (see below)
i have
Unhandled exception at 0x7333f179 (ntwdblib.dll) in php.exe:
0xC0000005: Access violation reading location 0x003effff.
Reproduce code:
---------------
<?
/**
// this code working fine, but i'm need connect to remote MSSQL 2005
Standart Server (not Express)
$mssql=mssql_connect('.\SQLEXPRESS','sa','sysdba') or
die('Error
MSSQL Connect '.mssql_get_last_message());
var_dump($mssql);
*/
$mssql=mssql_connect('192.168.x.x','sa','sysdba') or die('Error
MSSQL
Connect '.mssql_get_last_message());
var_dump($mssql);
?>
Expected result:
----------------
resource(4) of type (mssql link)
Actual result:
--------------
crash php.exe
with debug backtrace
> ntwdblib.dll!_ChangeName@8() + 0x2a bytes
ntwdblib.dll!_PrintMessage@12() + 0x2a5 bytes
ntwdblib.dll!_HandleInfoToken@8() + 0x112 bytes
ntwdblib.dll!_dbresults() + 0x341 bytes
ntwdblib.dll!_dbopen() + 0xdfe bytes
php_mssql.dll!php_mssql_do_connect(int ht=17745128, _zval_struct *
return_value=0x010ec4d0, _zval_struct * * return_value_ptr=0x00000000,
_zval_struct * this_ptr=0x00000000, int return_value_used=1, void * * *
tsrm_ls=0x00222450, int persistent=0) Line 661 + 0xb bytes C
php_mssql.dll!zif_mssql_connect(int ht=3, _zval_struct *
return_value=0x010ec4d0, _zval_struct * * return_value_ptr=0x00000000,
_zval_struct * this_ptr=0x00000000, int return_value_used=1, void * * *
tsrm_ls=0x00222450) Line 724 + 0x25 bytes C
php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data=0x00c0fbd0, void * * * tsrm_ls=0x00222450) Line 200 + 0x3d
bytes C
php5ts.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data *
execute_data=0x00000000, void * * * tsrm_ls=0x00222450) Line 1729 + 0xe
bytes C
php5ts.dll!execute(_zend_op_array * op_array=0x00000008, void * * *
tsrm_ls=0x00222450) Line 92 + 0xc bytes C
php5ts.dll!php_execute_script(_zend_file_handle *
primary_file=0x00c0fec8, void * * * tsrm_ls=0x00222450) Line 2023 +
0x12 bytes C
php.exe!main(int argc=5, char * * argv=0x00223f70) Line 1134 C
php.exe!_mainCRTStartup() + 0xe3 bytes
kernel32.dll!7c816d4f()
----------------------------------------------
when i change settings php.ini
mssql.secure_connection = On
i have other errors when php_mssql.dll try using NT Authorization
Warning: mssql_connect(): message: Login failed for user 'westltp'. The
user is not associated with a trusted SQL Server connection. (Microsoft
SQL Server, error: 18452) (severity 14) in
C:\usr\local\apache\htdocs\test\mssql_connect.php on line 6
Warning: mssql_connect(): Login incorrect. (severity 2) in
C:\usr\local\apache\htdocs\test\mssql_connect.php on line 6
Warning: mssql_connect(): Unable to connect to server: 192.168.x.x in
C:\usr\local\apache\htdocs\test\mssql_connect.p
hp on line 6
Error MSSQL Connect Login failed for user 'westltp'. The user is not
associated with a trusted SQL Server connection. (Microsoft SQL Server,
error: 18452)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47072&edit=1