Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用包含€;_Php_Sql Server_Pdo - Fatal编程技术网

Php 使用包含€;

Php 使用包含€;,php,sql-server,pdo,Php,Sql Server,Pdo,我正试图从linux服务器登录到mssql服务器,不幸的是密码剑包含字符€。看起来这个角色没有被正确地发送。有人知道怎么做吗 正如您在日志中看到的,freedts配置正在工作,并且正在将主机名解析为正确的ip和端口。但仔细看看发送密码的包,似乎€正被..取代 00d0 00 09 4d 79 e2 82 ac 50-61 73 73 77 6f 72 64 00 |..My...P assword.| freetds.conf php that^并检查服务器的默认编码。编辑:现在上面的评论被

我正试图从linux服务器登录到
mssql服务器
,不幸的是密码剑包含字符
。看起来这个角色没有被正确地发送。有人知道怎么做吗

正如您在日志中看到的,freedts配置正在工作,并且正在将主机名解析为正确的ip和端口。但仔细看看发送密码的包,似乎
正被
..
取代

00d0 00 09 4d 79 e2 82 ac 50-61 73 73 77 6f 72 64 00 |..My...P assword.|

freetds.conf

php


that^并检查服务器的默认编码。编辑:现在上面的评论被删除了。
PHP
文件是用
UTF-8
编码的,我不是用
mysql
而是用
mssql
来做这件事,我只是看到了sql server的标志。。。我的错。对不起,胆小鬼;)我将更改链接主题mentiod上的密码^^^ ^
OP
,他在dsn中添加字符集后才开始看到转换,但转换已在我的日志文件中发生。反正
也会转换为
[mannequin]
        host = XX.XXX.XXX.XXX
        port = 55214
        tds version = auto
        dump file = /var/www/vhosts/example.com/httpdocs/temp/freetds.log
<?php
        $servername = 'mannequin';
        $user = 'webshop';
        $pass = 'My€Password';
        //$pass = 'azerty';
        $dsn = 'dblib:charset=UTF-8;host='.$servername;

        try {
            $con = new PDO($dsn, $user, $pass);
        }catch(\Exception $e) {
            echo $e->getMessage().'<hr />';
            highlight_file(__DIR__ . '/../../temp/freedts.log');
        }
        exit;
log.c:196:Starting log file for FreeTDS 0.91
    on 2018-01-25 17:38:30 with debug flags 0x4fff.
iconv.c:330:tds_iconv_open(0x7f0f2b5f1670, 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 XX.XXX.XXX.XXX port 55214 (TDS version 4.2)
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-70 75 62 6c 69 34 75 2d |........ xxxxxxx-|
0010 77 65 62 30 30 32 2e 73-72 76 2e 63 6f 6d 62 65 |xxxxxx.s rv.xxxxx|
0020 6c 6c 2d 6f 70 73 1e 77-65 62 73 68 6f 70 00 00 |ll-ops.w ebshop..|
0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
0040 00 00 00 00 00 07 4d 79-e2 82 ac 50 61 73 73 77 |......My ...Passw|
0050 6f 72 64 00 00 00 00 00-00 00 00 00 00 00 00 00 |ord..... ........|
0060 00 00 00 00 0d 31 33 39-33 36 00 00 00 00 00 00 |.....139 36......|
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 02 00 |........ ........|
0090 00 00 00 00 50 48 50 20-66 72 65 65 74 64 73 00 |....PHP  freetds.|
00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00b0 00 00 0b 6d 61 6e 6e 65-71 75 69 6e 00 00 00 00 |...manne quin....|
00c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ ........|
00d0 00 09 4d 79 e2 82 ac 50-61 73 73 77 6f 72 64 00 |..My...P assword.|
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 0d 04 02 00 00 44 42-2d 4c 69 62 72 61 72 79 |......DB -Library|
01e0 0a 00 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 4c 00 00 00 00-00 00 00 00 00 00 0a 00 |...L.... ........|
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-00 00 00 00             |........ ....|

token.c:328:tds_process_login_tokens()
net.c:555:Received header
0000 04 01 00 50 00 37 01 00-                        |...P.7..|

net.c:609:Received packet
0000 04 01 00 50 00 37 01 00-aa 3c 00 18 48 00 00 01 |...P.7.. .<..H...|
0010 0e 20 00 4c 6f 67 69 6e-20 66 61 69 6c 65 64 20 |. .Login  failed |
0020 66 6f 72 20 75 73 65 72-20 27 77 65 62 73 68 6f |for user  'websho|
0030 70 27 2e 10 53 45 52 56-45 52 50 43 5c 53 51 4c |p'..SERV ERPC\SQL|
0040 32 30 31 34 00 01 00 fd-02 00 00 00 00 00 00 00 |2014.... ........|

token.c:337:looking for login token, got  aa(ERROR)
token.c:122:tds_process_default_tokens() marker is aa(ERROR)
token.c:2588:tds_process_msg() reading message 18456 from server
token.c:2661:tds_process_msg() calling client msg handler
dbutil.c:85:_dblib_handle_info_message(0x7f0f27e41c70, 0x7f0f2b5f1670, 0x7fff42a4de00)
dbutil.c:86:msgno 18456: "Login failed for user 'webshop'."
dblib.c:5780:dbgetuserdata(0x7f0f2b5927f0)
dblib.c:5780:dbgetuserdata(0x7f0f2b5927f0)
token.c:2674:tds_process_msg() returning TDS_SUCCEED
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 = 1
        done_count_valid = 0
token.c:2355:tds_process_end() state set to TDS_IDLE
token.c:2370:                rows_affected = 0
token.c:438:tds_process_login_tokens() returning TDS_FAIL
login.c:466:login packet accepted
util.c:156:Changed query state from IDLE to DEAD
util.c:331:tdserror(0x7f0f27e41c70, 0x7f0f2b5f1670, 20002, 0)
dblib.c:7929:dbperror(0x7f0f2b5927f0, 20002, 0)
dblib.c:7981:20002: "Adaptive Server connection failed"
dblib.c:5780:dbgetuserdata(0x7f0f2b5927f0)
dblib.c:8002:"Adaptive Server connection failed", client returns 2 (INT_CANCEL)
util.c:361:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:384:tdserror: returning TDS_INT_CANCEL(2)
dblib.c:1443:dbclose(0x7f0f2b5927f0)
dblib.c:258:dblib_del_connection(0x7f0f0d351640, 0x7f0f2b5f1670)
mem.c:615:tds_free_all_results()
dblib.c:305:dblib_release_tds_ctx(1)
dblib.c:5882:dbfreebuf(0x7f0f2b5927f0)