Share via

php connect sql server with odbc Segmentation fault.

朝云 皇甫 0 Reputation points
2023-05-04T17:54:11.6433333+00:00

我使用php7.4.0 连接sql server 2008 R2,odbc17, sqlsrv pdo_sqlsrv 都是 5.8.1

我使用gdb调试的堆栈结果

Program received signal SIGSEGV, Segmentation fault.

0x00007ffff58a3781 in EVP_MD_CTX_cleanup () from /lib64/libcrypto.so.10

(gdb) bt

#0 0x00007ffff58a3781 in EVP_MD_CTX_cleanup () from /lib64/libcrypto.so.10

#1 0x00007fffdd27f369 in EVP_MD_CTX_free () from /usr/lib64/php/modules/mongodb.so

#2 0x00007fffc8c1a255 in ssl3_free_digest_list () from /usr/local/lib64/libssl.so.1.1

#3 0x00007fffc8c1ad63 in ssl3_clear () from /usr/local/lib64/libssl.so.1.1

#4 0x00007fffc8c53039 in tls1_clear () from /usr/local/lib64/libssl.so.1.1

#5 0x00007fffc8c1aaca in ssl3_new () from /usr/local/lib64/libssl.so.1.1

#6 0x00007fffc8c52fd9 in tls1_new () from /usr/local/lib64/libssl.so.1.1

#7 0x00007fffc8c2c3bf in SSL_new () from /usr/local/lib64/libssl.so.1.1

#8 0x00007fffc8fe5ae6 in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#9 0x00007fffc8fe0542 in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#10 0x00007fffc8fe0e0c in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#11 0x00007fffc8faae3f in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#12 0x00007fffc8fa89db in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#13 0x00007fffc8fa9544 in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#14 0x00007fffc8f182d9 in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#15 0x00007fffc8f4c94e in ?? () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#16 0x00007fffc8f176fa in SQLDriverConnectW () from /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.2.1

#17 0x00007fffda78d44b in SQLDriverConnectW () from /lib64/libodbc.so.2

#18 0x00007fffda10c7e5 in core_odbc_connect(sqlsrv_conn*, std::string&, bool) () from /usr/lib64/php/modules/pdo_sqlsrv.so

#19 0x00007fffda10e302 in core_sqlsrv_connect(sqlsrv_context&, sqlsrv_context&, sqlsrv_conn* ()(void, bool ()(sqlsrv_context&, unsigned int, bool, __va_list_tag () [1]), void*), char const*, char const*, char const*, _zend_array*, bool ()(sqlsrv_context&, unsigned int, bool, __va_list_tag () [1]), connection_option const*, void*, char const*) () from /usr/lib64/php/modules/pdo_sqlsrv.so

#20 0x00007fffda10507d in pdo_sqlsrv_db_handle_factory(_pdo_dbh_t*, _zval_struct*) () from /usr/lib64/php/modules/pdo_sqlsrv.so

#21 0x00007fffe14b038a in zim_PDO_dbh_constructor () from /usr/lib64/php/modules/pdo.so

#22 0x00007fffed21279d in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so

#23 0x0000555555649030 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER ()

#24 0x00005555558cc9fd in execute_ex ()

#25 0x00007fffed212033 in xdebug_execute_ex () from /usr/lib64/php/modules/xdebug.so

#26 0x00005555558d3c41 in zend_execute ()

#27 0x000055555584dd33 in zend_execute_scripts ()

#28 0x00005555557ecc00 in php_execute_script ()

#29 0x00005555558d5d3c in do_cli ()

#30 0x0000555555656d09 in main ()

使用了其他版本也是同样的结果,我应该怎么办

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-05-05T02:56:35.0366667+00:00

    Hi @朝云 皇甫

    Based on your description, this issue seems to be more related to PHP code. I'm not very familiar with PHP, and I suggest you go to PHP forums for help.

    For example: https://phpcommunity.org/.

    Hope this can help you.

    Best regards,

    Aniya

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.