|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-04-20 07:45 UTC] fuzzywy at 163 dot com
Description:
------------
The problem is that i can connect sybase with freetds, while pdo_dblib get error.
===
freetds.conf
[sybase]
host = 7.140.28.88
port = 26401
tds version = 5.0
===
test script
php -r "new PDO('dblib:host=7.140.28.88:26401;dbname=dwhdb','dcbo','dcbo');"
Expected result:
----------------
connect to sybase server
Actual result:
--------------
PDOException thrown
Fatal error: Uncaught PDOException: SQLSTATE[HY000] General SQL Server error: Check messages from the SQL Server (severity 15) in Command line code:1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 14:00:02 2025 UTC |
the session log connect with tsql =========================== log.c:196:Starting log file for FreeTDS 0.91 on 2017-05-16 09:23:39 with debug flags 0x4fff. iconv.c:330:tds_iconv_open(0x1e123b0, UTF-8) iconv.c:187:local name for ISO-8859-1 is ISO-8859-1 iconv.c:187:local name for UTF-8 is UTF-8 iconv.c:187:local name for UCS-2LE is UCS-2LE iconv.c:187:local name for UCS-2BE is UCS-2BE iconv.c:349:setting up conversions for client charset "UTF-8" iconv.c:351:preparing iconv for "UTF-8" <-> "UCS-2LE" conversion iconv.c:391:preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion iconv.c:394:tds_iconv_open: done net.c:205:Connecting to 10.40.57.148 port 2640 (TDS version 5.0) net.c:270:tds_open_socket: connect(2) returned "Operation now in progress" net.c:310:tds_open_socket() succeeded util.c:156:Changed query state from DEAD to IDLE net.c:741:Sending packet 0000 02 00 02 00 00 00 00 00-43 5a 31 38 36 00 00 00 |........ CZ186...| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0020 00 00 00 00 00 00 05 64-63 62 6f 00 00 00 00 00 |.......d cbo.....| 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0040 00 00 00 00 00 04 64 63-62 6f 00 00 00 00 00 00 |......dc bo......| 0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0060 00 00 00 00 04 34 34 38-35 30 00 00 00 00 00 00 |.....448 50......| 0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0080 00 00 00 05 03 01 06 0a-09 01 00 00 00 00 00 00 |........ ........| 0090 00 00 00 00 54 53 51 4c-00 00 00 00 00 00 00 00 |....TSQL ........| 00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00b0 00 00 04 74 65 73 74 00-00 00 00 00 00 00 00 00 |...test. ........| 00c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00d0 00 04 00 04 64 63 62 6f-00 00 00 00 00 00 00 00 |....dcbo ........| 00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01d0 00 06 05 00 00 00 54 44-53 2d 4c 69 62 72 61 72 |......TD S-Librar| 01e0 0a 05 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........ us_engli| 01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... ........| net.c:741:Sending packet 0000 02 01 00 61 00 00 00 00-00 00 00 00 00 00 0a 00 |...a.... ........| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 69 73 6f |........ .....iso| 0020 5f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |_1...... ........| 0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........ .....512| 0040 00 00 00 03 00 00 00 00-e2 16 00 01 09 00 08 0e |........ ........| 0050 6d 7f ff ff ff fe 02 09-00 00 00 00 02 68 00 00 |m....... .....h..| 0060 00 - |.| token.c:328:tds_process_login_tokens() net.c:555:Received header 0000 04 01 00 5a 00 00 00 00- |...Z....| net.c:609:Received packet 0000 04 01 00 5a 00 00 00 00-e3 08 00 03 05 69 73 6f |...Z.... .....iso| 0010 5f 31 00 e3 09 00 04 03-35 31 32 03 35 31 32 ad |_1...... 512.512.| 0020 16 00 05 05 00 00 00 0c-53 51 4c 20 41 6e 79 77 |........ SQL Anyw| 0030 68 65 72 65 10 00 00 00-e2 16 00 01 09 00 08 0e |here.... ........| 0040 61 01 ff ff fe e6 02 09-07 fe 3f 9e e6 68 00 00 |a....... ..?..h..| 0050 0a fd 00 00 01 00 d5 56-17 00 |.......V ..| token.c:337:looking for login token, got e3(ENVCHANGE) token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:2493:server indicated charset change to "iso_1" iconv.c:988:setting server single-byte charset to "ISO-8859-1" token.c:337:looking for login token, got e3(ENVCHANGE) token.c:122:tds_process_default_tokens() marker is e3(ENVCHANGE) token.c:2477:changing block size from 512 to 512 token.c:337:looking for login token, got ad(LOGINACK) token.c:373:server reports TDS version 5.0.0.0 token.c:375:Product name for 0x5000000 is unknown token.c:337:looking for login token, got e2(CAPABILITY) token.c:122:tds_process_default_tokens() marker is e2(CAPABILITY) token.c:337:looking for login token, got fd(DONE) token.c:122:tds_process_default_tokens() marker is fd(DONE) token.c:2339:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2355:tds_process_end() state set to TDS_IDLE token.c:2370: rows_affected = 1529557 token.c:438:tds_process_login_tokens() returning TDS_SUCCEED mem.c:615:tds_free_all_results() util.c:156:Changed query state from IDLE to QUERYING util.c:156:Changed query state from QUERYING to PENDING net.c:741:Sending packet 0000 0f 01 00 21 00 00 00 00-21 14 00 00 00 00 73 65 |...!.... !.....se| 0010 74 20 74 65 78 74 73 69-7a 65 20 36 34 35 31 32 |t textsi ze 64512| 0020 20 - | | token.c:540:tds_process_tokens(0x1e123b0, 0x7ffffda8e694, 0x7ffffda8e690, 0x100) util.c:156:Changed query state from PENDING to READING net.c:555:Received header 0000 04 01 00 11 00 00 00 00- |........| net.c:609:Received packet 0000 04 01 00 11 00 00 00 00-fd 00 00 01 00 00 00 00 |........ ........| 0010 00 - |.| token.c:555:processing result tokens. marker is fd(DONE) token.c:2339:tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 token.c:2355:tds_process_end() state set to TDS_IDLE util.c:156:Changed query state from READING to IDLE token.c:2370: rows_affected = 0 util.c:104:logic error: cannot change query state from IDLE to PENDING token.c:540:tds_process_tokens(0x1e123b0, 0x7ffffda8e694, 0x7ffffda8e690, 0x100) token.c:543:tds_process_tokens() state is COMPLETED mem.c:615:tds_free_all_results() util.c:156:Changed query state from IDLE to DEADThe log file which connect by pdo_dblib in php-5.5.15 ================================ 09:53:54.580743 14500 (log.c:196):Starting log file for FreeTDS 0.91 on 2017-05-16 09:53:54 with debug flags 0xffff. 09:53:54.580768 14500 (iconv.c:330):tds_iconv_open(0x1e54100, UTF-8) 09:53:54.580783 14500 (iconv.c:187):local name for ISO-8859-1 is ISO-8859-1 09:53:54.580787 14500 (iconv.c:187):local name for UTF-8 is UTF-8 09:53:54.580789 14500 (iconv.c:187):local name for UCS-2LE is UCS-2LE 09:53:54.580792 14500 (iconv.c:187):local name for UCS-2BE is UCS-2BE 09:53:54.580794 14500 (iconv.c:349):setting up conversions for client charset "UTF-8" 09:53:54.580798 14500 (iconv.c:351):preparing iconv for "UTF-8" <-> "UCS-2LE" conversion 09:53:54.580801 14500 (iconv.c:391):preparing iconv for "ISO-8859-1" <-> "ISO-8859-1" conversion 09:53:54.580804 14500 (iconv.c:394):tds_iconv_open: done 09:53:54.580811 14500 (net.c:205):Connecting to 10.40.57.148 port 2640 (TDS version 5.0) 09:53:54.580849 14500 (net.c:270):tds_open_socket: connect(2) returned "Operation now in progress" 09:53:54.583468 14500 (net.c:310):tds_open_socket() succeeded 09:53:54.583482 14500 (util.c:156):Changed query state from DEAD to IDLE 09:53:54.583489 14500 (net.c:741):Sending packet 0000 02 00 02 00 00 00 00 00-4d 61 73 74 65 72 00 00 |........ Master..| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0020 00 00 00 00 00 00 06 64-63 62 6f 00 00 00 00 00 |.......d cbo.....| 0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0040 00 00 00 00 00 04 64 63-62 6f 00 00 00 00 00 00 |......dc bo......| 0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0060 00 00 00 00 04 31 34 35-30 30 00 00 00 00 00 00 |.....145 00......| 0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0080 00 00 00 05 03 01 06 0a-09 01 00 00 00 00 00 00 |........ ........| 0090 00 00 00 00 50 48 50 20-47 65 6e 65 72 69 63 20 |....PHP Generic | 00a0 44 42 2d 6c 69 62 00 00-00 00 00 00 00 00 00 00 |DB-lib.. ........| 00b0 00 00 12 31 30 2e 34 30-2e 35 37 2e 31 34 38 3a |...10.40 .57.148:| 00c0 32 36 34 30 00 00 00 00-00 00 00 00 00 00 00 00 |2640.... ........| 00d0 00 11 00 04 64 63 62 6f-00 00 00 00 00 00 00 00 |....dcbo ........| 00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........| 01d0 00 06 05 00 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB -Library| 01e0 0a 05 00 00 00 00 0d 11-75 73 5f 65 6e 67 6c 69 |........ us_engli| 01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... ........| 09:53:54.583568 14500 (net.c:741):Sending packet 0000 02 01 00 61 00 00 00 00-00 00 00 00 00 00 0a 00 |...a.... ........| 0010 00 00 00 00 00 00 00 00-00 00 00 00 00 75 74 66 |........ .....utf| 0020 38 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |8....... ........| 0030 00 00 00 00 00 00 00 00-00 00 00 04 01 35 31 32 |........ .....512| 0040 00 00 00 03 00 00 00 00-e2 16 00 01 09 00 08 0e |........ ........| 0050 6d 7f ff ff ff fe 02 09-00 00 00 00 02 68 00 00 |m....... .....h..| 0060 00 - |.| 09:53:54.583591 14500 (token.c:328):tds_process_login_tokens() 09:53:54.589622 14500 (net.c:555):Received header 0000 04 01 00 59 00 00 00 00- |...Y....| 09:53:54.589637 14500 (net.c:609):Received packet 0000 04 01 00 59 00 00 00 00-e3 07 00 03 04 75 74 66 |...Y.... .....utf| 0010 38 00 e3 09 00 04 03 35-31 32 03 35 31 32 ad 16 |8......5 12.512..| 0020 00 05 05 00 00 00 0c 53-51 4c 20 41 6e 79 77 68 |.......S QL Anywh| 0030 65 72 65 10 00 00 00 e2-16 00 01 09 00 08 0e 61 |ere..... .......a| 0040 01 ff ff fe e6 02 09 07-fe 3f 9e e6 68 00 00 0a |........ .?..h...| 0050 fd 00 00 01 00 e0 59 17-00 |......Y. .| 09:53:54.630485 14500 (token.c:337):looking for login token, got e3(ENVCHANGE) 09:53:54.630497 14500 (token.c:122):tds_process_default_tokens() marker is e3(ENVCHANGE) 09:53:54.630508 14500 (token.c:2493):server indicated charset change to "utf8" 09:53:54.630517 14500 (iconv.c:988):setting server single-byte charset to "UTF-8" 09:53:54.630524 14500 (dblib.c:327):db_env_chg(0x1e54100, 3, , utf8) 09:53:54.630529 14500 (token.c:337):looking for login token, got e3(ENVCHANGE) 09:53:54.630534 14500 (token.c:122):tds_process_default_tokens() marker is e3(ENVCHANGE) 09:53:54.630538 14500 (token.c:2477):changing block size from 512 to 512 09:53:54.630542 14500 (dblib.c:327):db_env_chg(0x1e54100, 4, 512, 512) 09:53:54.630547 14500 (token.c:337):looking for login token, got ad(LOGINACK) 09:53:54.630551 14500 (token.c:373):server reports TDS version 5.0.0.0 09:53:54.630555 14500 (token.c:375):Product name for 0x5000000 is unknown 09:53:54.630559 14500 (token.c:337):looking for login token, got e2(CAPABILITY) 09:53:54.630564 14500 (token.c:122):tds_process_default_tokens() marker is e2(CAPABILITY) 09:53:54.630568 14500 (token.c:337):looking for login token, got fd(DONE) 09:53:54.630573 14500 (token.c:122):tds_process_default_tokens() marker is fd(DONE) 09:53:54.630579 14500 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 09:53:54.630583 14500 (token.c:2355):tds_process_end() state set to TDS_IDLE 09:53:54.630587 14500 (token.c:2370): rows_affected = 1530336 09:53:54.630591 14500 (token.c:438):tds_process_login_tokens() returning TDS_SUCCEED 09:53:54.630600 14500 (mem.c:615):tds_free_all_results() 09:53:54.630605 14500 (util.c:156):Changed query state from IDLE to QUERYING 09:53:54.630609 14500 (util.c:156):Changed query state from QUERYING to PENDING 09:53:54.630614 14500 (net.c:741):Sending packet 0000 0f 01 00 21 00 00 00 00-21 14 00 00 00 00 73 65 |...!.... !.....se| 0010 74 20 74 65 78 74 73 69-7a 65 20 36 34 35 31 32 |t textsi ze 64512| 0020 20 - | | 09:53:54.630639 14500 (token.c:540):tds_process_tokens(0x1e54100, 0x7ffc5a301844, 0x7ffc5a301840, 0x100) 09:53:54.630645 14500 (util.c:156):Changed query state from PENDING to READING 09:53:54.646789 14500 (net.c:555):Received header 0000 04 01 00 11 00 00 00 00- |........| 09:53:54.646802 14500 (net.c:609):Received packet 0000 04 01 00 11 00 00 00 00-fd 00 00 01 00 00 00 00 |........ ........| 0010 00 - |.| 09:53:54.646814 14500 (token.c:555):processing result tokens. marker is fd(DONE) 09:53:54.646819 14500 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 09:53:54.646824 14500 (token.c:2355):tds_process_end() state set to TDS_IDLE 09:53:54.646828 14500 (util.c:156):Changed query state from READING to IDLE 09:53:54.646832 14500 (token.c:2370): rows_affected = 0 09:53:54.646836 14500 (util.c:104):logic error: cannot change query state from IDLE to PENDING 09:53:54.646840 14500 (token.c:540):tds_process_tokens(0x1e54100, 0x7ffc5a301844, 0x7ffc5a301840, 0x100) 09:53:54.646845 14500 (token.c:543):tds_process_tokens() state is COMPLETED 09:53:54.646850 14500 (dblib.c:239):dblib_add_connection(0x7fed67e43660, 0x1e54100) 09:53:54.646856 14500 (dblib.c:1398):dbuse(0x1e535c0, dwhdb) 09:53:54.646861 14500 (dblib.c:1312):dbcmd(0x1e535c0, use [dwhdb]) 09:53:54.646870 14500 (dblib.c:1319):dbcmd() bufsz = 0 09:53:54.646879 14500 (dblib.c:1369):dbsqlexec(0x1e535c0) 09:53:54.646884 14500 (dblib.c:6862):dbsqlsend(0x1e535c0) 09:53:54.646889 14500 (mem.c:615):tds_free_all_results() 09:53:54.646893 14500 (util.c:156):Changed query state from IDLE to QUERYING 09:53:54.646897 14500 (util.c:156):Changed query state from QUERYING to PENDING 09:53:54.646901 14500 (net.c:741):Sending packet 0000 0f 01 00 19 00 00 00 00-21 0c 00 00 00 00 75 73 |........ !.....us| 0010 65 20 5b 64 77 68 64 62-5d |e [dwhdb ]| 09:53:54.646922 14500 (dblib.c:4639):dbsqlok(0x1e535c0) 09:53:54.646927 14500 (dblib.c:4669):dbsqlok() not done, calling tds_process_tokens() 09:53:54.646931 14500 (token.c:540):tds_process_tokens(0x1e54100, 0x7ffc5a301cbc, 0x7ffc5a301cb8, 0x6914) 09:53:54.646936 14500 (util.c:156):Changed query state from PENDING to READING 09:53:54.655803 14500 (net.c:555):Received header 0000 04 01 00 11 00 00 00 00- |........| 09:53:54.655816 14500 (net.c:609):Received packet 0000 04 01 00 11 00 00 00 00-fd 00 00 01 00 00 00 00 |........ ........| 0010 00 - |.| 09:53:54.655826 14500 (token.c:555):processing result tokens. marker is fd(DONE) 09:53:54.655830 14500 (token.c:2339):tds_process_end: more_results = 0 was_cancelled = 0 error = 0 done_count_valid = 0 09:53:54.655835 14500 (token.c:2355):tds_process_end() state set to TDS_IDLE 09:53:54.655839 14500 (util.c:156):Changed query state from READING to IDLE 09:53:54.655843 14500 (token.c:2370): rows_affected = 0 09:53:54.655847 14500 (util.c:104):logic error: cannot change query state from IDLE to PENDING 09:53:54.655853 14500 (dblib.c:4707):dbsqlok() end status is SUCCEED 09:53:54.655857 14500 (dblib.c:4718):dbsqlok() end status was success 09:53:54.655863 14500 (dblib.c:1668):dbresults(0x1e535c0) 09:53:54.655867 14500 (dblib.c:1674):dbresults: dbresults_state is 5 (_DB_RES_SUCCEED) 09:53:54.655871 14500 (dblib.c:1657):dbresults returning 1 (SUCCEED) 09:53:54.655876 14500 (dblib.c:5854):dbcanquery(0x1e535c0) 09:53:54.655880 14500 (token.c:540):tds_process_tokens(0x1e54100, 0x7ffc5a301cdc, (nil), 0x108) 09:53:54.656060 14500 (token.c:543):tds_process_tokens() state is COMPLETED 09:53:54.656070 14500 (dblib.c:1443):dbclose(0x1e535c0) 09:53:54.656074 14500 (dblib.c:258):dblib_del_connection(0x7fed67e43660, 0x1e54100) 09:53:54.656079 14500 (mem.c:615):tds_free_all_results() 09:53:54.656097 14500 (util.c:156):Changed query state from IDLE to DEAD 09:53:54.656104 14500 (dblib.c:305):dblib_release_tds_ctx(1) 09:53:54.656112 14500 (dblib.c:5882):dbfreebuf(0x1e535c0) 09:53:54.656117 14500 (dblib.c:739):dbloginfree(0x1e53410) 09:53:54.656720 14500 (dblib.c:1512):dbexit(void) 09:53:54.656995 14500 (dblib.c:1512):dbexit(void) 09:53:54.657007 14500 (dblib.c:305):dblib_release_tds_ctx(1)