在Debian 9 Stretch中配置dblib

时间:2019-01-30 11:05:39

标签: php sql-server debian-stretch

我要连接到sqlserver

我有这个

php -v 
PHP 7.2.14-1+0~20190113100742.14+stretch~1.gbpd83c69 (cli) (built: Jan 13
2019 10:07:43) ( NTS )Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.14-1+0~20190113100742.14+stretch~1.gbpd83c69, Copyright (c) 1999-2018, by Zend Technologies

enter image description here

我使用sqlser的地方

$conn = new PDO('sqlsrv:Server=xxx.xxx.xxx.xxx;Database=xxxx', 'user', 'pass');

我有这个问题

SQLSTATE[01000]: [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1' : file not found

但是此文件在路径

中退出

当我使用DBLIB时

$conn = new PDO( "dblib:host=$hostname;dbname=$dbname;", $username, $pw);

许多秒(2分钟)后,我遇到了这个问题

SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)

0 个答案:

没有答案